Codex graded its own rewrite 10/10. My review found four mistakes
On November 1, I ran five text drafts through Codex, OpenAI's coding agent. Its job: remove the AI tells without touching the facts. Its report listed a few light changes, and a grade. 10/10. My review found four correc
On November 1, I ran five text drafts through Codex, OpenAI's coding agent. Its job: remove the AI tells without touching the facts. Its report listed a few light changes, and a grade. 10/10.
My review found four corrections to make. One of them was a mistake Codex had created itself.
TL;DR: an agent that grades its own work is not a control. The same model generates and judges, and research shows it favors itself. Keep an outside judge with two parts. A script compares what must not change: numbers, commands, quotes, signature. A human reads the rest: a broken reference, a verb tense, a question left hanging. The agent's grade plays no part in the decision.
This article is for developers who have an AI agent review or grade a piece of work. Its own, or another agent's.
The context: a read-only "humanize" pass
I run some drafts through Codex for a second pass. I call it the "humanize" pass.
The command fits on one line:
codex exec -s read-only -m gpt-5.6-sol
exec runs Codex without a conversation. It gets an instruction, answers, stops. -s read-only is the read-only sandbox: Codex reads my files and writes nothing. The prompt is built from three documents. My humanize guide, my list of AI tells in English and French, and my voice file.
An AI tell is a writing habit that gives away generated text. The em dash, the semicolon, the parenthesis that slips in a detail. My voice file describes how I write. Informal French, short sentences.
The instruction comes down to one sentence. Remove the tells, keep every fact, every number, every quote and the signature.
A 10/10 nobody asked for measures nothing
Codex returned its five texts with a report: a few light changes, and 10/10.
I had not asked for a grade. And that grade measures nothing outside the model. The model that rewrote is the one that judges. It compares its text with its own reading of the instruction. It does not know what I would have fixed.
This bias has had a name since 2023. Zheng and his co-authors call it self-enhancement bias: a judge rates answers that look like its own higher. In 2024, Panickssery, Bowman and Feng showed the mechanism. GPT-4 and Llama 2 can pick out their own text among others. The better a model recognizes itself, the more it prefers itself.
A self-awarded 10/10 is an opinion about oneself. Not a measurement.
An agent that grades its own work is not a control. Top, the 10/10 Codex gave itself and my four corrections. Bottom, the judge I keep: a script for the invariants, a human for the meaning.
My review, draft by draft
I reread the five drafts with the before and after texts side by side. Here is what Codex had changed, and what I then had to change.
The tally. I kept Codex's changes. I fixed one it had made worse, in draft 3. And I made three corrections it had missed. Four corrections after a 10/10.
None of them is serious. That is exactly the problem. A report that says 10/10 invites you to skip the review.
Research says the same thing, on longer loops
Three recent papers look at what happens when an agent grades itself.
Park and Choi (July 2026) ran an agent on long autonomous loops. The agent decided on its own whether each cycle had made progress. It claimed progress in every cycle. Yet more than half of the cycles had gained nothing, or had regressed. The authors call this the "progress mirage". Their conclusion: a bigger judge is not enough. You need a judge that looks at the real world, out of the agent's reach.
Canedo (August 2026) had Claude Sonnet grade code produced by six models. He flags the limit himself: a judge from the same family as one of the candidates. So he had GPT-5 re-grade thirty trials. The largest disagreement was on constraint compliance, where GPT-5 was more lenient. Another result: an agent that runs its own tests gives an objective signal, tied to final quality. One that does not should not be trusted without external validation.
Szeider (September 2025) left six models running with no task, then had them rate their own behavior out of ten. Some gave themselves 1. Others 8.3. Agreement between judges was 0.23. The author infers that a model which rates itself low can be led to rate itself much higher.
Three different settings, one finding. The grade depends on who grades. And when the candidate grades, the grade says nothing.
The two-part control: the machine for invariants, the human for meaning
After the Codex pass, a control runs. Codex did not write it and nobody asks for its opinion. It has two parts.
The mechanical part checks the invariants. An invariant is what must be identical before and after. In my case: the numbers, the commands, the quotes and the signature. The script extracts these from both versions and compares them. It also checks what must no longer exist: em dash, semicolon, parenthesis. Then three style rules. Informal address in French, at most one colon per text, no sentence over 20 words.
The core of the script is a few lines of shell:
# What must not move: numbers and quotes
inv() { grep -oE '[0-9]+([,.][0-9]+)?|ยซ[^ยป]*ยป' "$1" | sort; }
diff <(inv before.md) <(inv after.md) && echo "invariants: OK"
# What must no longer exist: dashes, semicolons, parentheses
! grep -nP '[\x{2013}\x{2014};()]' after.md && echo "tells: OK"
# Sentences over 20 words
tr '\n' ' ' < after.md | tr '.!?' '\n' | awk 'NF > 20 { print NF " words: " $0 }'
A script has three qualities no model has. It does not get tired, as I wrote in the article on human vigilance. It does not recognize its own text. And it has no opinion on quality: it compares.
The human part reads for meaning. The script cannot see a possessive that no longer points to anything. Nor a verb tense that no longer matches. Nor a closing question left hanging. Of my four corrections, only one falls under a mechanical rule: the 21-word sentence. The other three needed a reader.
Order matters. The script runs first and leaves the human a short read. The less there is to read, the more real the reading is.
Two readers described the same trap to me
On October 30, I published a LinkedIn post about a habit: taking the option the AI recommends. By early afternoon it had 62 reactions. Two comments stayed with me.
One reader says the AI readily endorses his counterproposals. So he compares with a second AI, and keeps the structural decisions for himself. Another accepted a result that looked coherent. When he later wanted to change it, he could no longer explain the choices.
The first found Canedo's remedy on his own. A second judge, from another vendor, with nothing to defend. The second describes what happens with no judge at all. The result looked good. Nobody had checked what.
What this changes for your coding agents
My example is about text. The mechanism is the same when a coding agent signs off with "tests green, everything compliant". That is a self-grade, with words instead of a number.
I already wrote that an agent must deliver proof, not claims. The self-grade is the most tempting claim, because it looks like a measurement. Replace it with things you can check without the agent.
- The exit code of the tests, run by your harness, not reported by the agent.
- A diff of the invariants: public signatures, migrations, constants that were not supposed to move.
- A review by a model from another vendor, if you want an automatic second opinion.
- A human on the diff that matters, with a short list to look at.
And never ask the agent for a grade. Ask for an artifact. A results file, a command output, a diff. The script reads the artifact. You read the rest.
The checklist
An agent that grades itself is not a control. The judge must be out of its reach.
- [ ] Ignore any grade an agent gives itself, even one you did not ask for
- [ ] List your invariants before the pass: numbers, commands, quotes, signature
- [ ] Write a script that compares those invariants before and after, and hunts what must no longer exist
- [ ] Run the script first, the human second, on a short list
- [ ] Read for meaning: references, verb tenses, questions left hanging
- [ ] For an automatic second opinion, pick a model from another vendor
- [ ] For code, demand the artifact: test output, diff, exit code
The takeaway
Codex did its job well. Its changes were right, except for one reference. The problem is not the pass. It is the 10/10, and what it invites you to skip.
An agent that grades itself tells you what it thinks of itself. A script tells you what changed. A reader tells you whether it still holds. Keep the last two.
Want to put this kind of control around your agents, on text or on code? Let's talk.
Sources: Park & Choi, When Do Agent Loops Mistake Stagnation for Progress? (arXiv, 2026) ยท Canedo, Architecture as Capability Equalizer for Coding Agents (arXiv, 2026) ยท Szeider, What Do LLM Agents Do When Left Alone? (arXiv, 2025) ยท Zheng et al., Judging LLM-as-a-Judge (2023) ยท Panickssery, Bowman & Feng, LLM Evaluators Recognize and Favor Their Own Generations (2024) ยท OpenAI, Codex CLI reference ยท OpenAI, Codex sandboxing
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.