Agent review · #1
Why an AI Agent Misses Its Own Bugs
A model reviewing its own code scores patterns close to its training distribution more favorably. Four published studies and four safeguards for cross-model code review.
by Mike, founder of Aubia Published on 7 min read
- cross-review
- ai-agents
- code-review
- testing



In the Creator's letter, I put it plainly: the easiest way to miss an error is to be the one who wrote it. A developer reviewing their own diff often reads back their intent rather than the code actually saved.
With an AI agent, you might think a fresh session erases that bias. The conversation history is gone, the prompt switches roles, and the model inspects the patch as unfamiliar code. Yet the same model often approves patches containing its own blind spots. Since 2024, four empirical studies have documented this bias and measured when a second pass by another model fixes code and when it degrades it.
Statistical Familiarity Skews Self-Review
A large language model does not "defend" its code out of attachment. Its bias comes from how it estimates the probability of a token sequence: perplexity, which measures how surprising a piece of text or code looks relative to its training distribution. The closer a pattern is to what the model would have generated itself, the lower its perplexity.
In Self-Preference Bias in LLM-as-a-Judge, Koki Wataoka, Tsubasa Takahashi and Ryokan Ri show that LLM judges assign higher scores to low-perplexity text than human evaluators do, even when the judge did not write the text. A model reviewing its own patch recognizes its own reasoning shortcuts, default assumptions and error-handling style. Everything looks coherent and familiar, which lowers the chance it will challenge a missing boundary condition. I verified this on this site in ReadIndexNowSnapshotQuery.php, which computes the IndexNow fingerprint of published articles: a self-review passes right over the missing series_order key on line 49, whereas another model family checks the fingerprint against the rendered fields and flags the bug.
Two other effects compound this familiarity. AI sycophancy pushes a model trained to be cooperative toward approving a plausible implementation rather than rejecting it over a subtle doubt. Alongside that, Quantifying Label-Induced Bias in Large Language Model Self- and Cross-Evaluations by Saraf et al. measures how merely exposing clues about an excerpt's author or origin shifts evaluation severity, regardless of the text's actual quality.
Cross-Review Is Asymmetric and Can Also Degrade a Diff
Having one agent reviewed by another model family reduces familiarity bias, with results that vary depending on the direction of the pairing. Measurements refute the assumption that a second model always improves on the first.
In July 2026, Zuodong Xiang, Yike Zhang, YueMing Zhang and Hailu Xu published Cross-Model LLM Code Review: Should you use Claude to review Codex or vice versa? (accepted at the Agentic SE workshop at KDD 2026). They measured pass rates across 116 medium and hard LiveCodeBench tasks by pairing Claude Opus 4.7 and Codex GPT-5.5.
| Code author | Review mode | Pass rate | Delta vs. single model |
|---|---|---|---|
| Codex GPT-5.5 | None (solo) | 71.6% | Baseline |
| Codex GPT-5.5 | Codex self-review | 84.5% | +12.9 pts |
| Codex GPT-5.5 | Reviewed by Claude Opus 4.7 | 89.7% | +18.1 pts |
| Claude Opus 4.7 | None (solo) | 91.4% | Baseline |
| Claude Opus 4.7 | Claude self-review | 91.4% | 0 pts |
| Claude Opus 4.7 | Reviewed by Codex GPT-5.5 | 82.8% | -8.6 pts |
When Claude reviews Codex, cross-review gains 18.1 points over the solo model and clearly outperforms self-review. Conversely, when Codex reviews Claude without an external verification safety net, poorly calibrated edits pull the pass rate down by 8.6 points, while Claude's self-review stays flat at 91.4%.
Two commercial providers still overlap in their blind spots. Their models train on much of the same public corpora and recurring coding patterns. Switching providers narrows those overlaps without eliminating them.
Stacking Agents Is Not Enough Without a Verification Contract
Adding roles (a coder, a reviewer, a tester) leaves a vague workflow intact. In Why Do Multi-Agent LLM Systems Fail?, Mert Cemri, Melissa Z. Pan, Ion Stoica, Matei Zaharia and their colleagues at UC Berkeley annotated over 1,600 execution traces from seven multi-agent frameworks (with failure rates ranging from 41% to 86.7% across systems).
Their MAST taxonomy (Multi-Agent System Failure Taxonomy) groups fourteen failure modes into three categories: roughly 44% stem from system design (ambiguous instructions, context loss, dead-end loops), roughly 32% from inter-agent misalignment (constraints dropped during a handoff) and roughly 24% from verification (premature termination or approval without real checks).
Left free to comment on a diff without strict rules, a second agent therefore gravitates toward one of two extremes: either it signs off too fast out of sycophancy, or it suggests cosmetic or risky edits that break an already covered test case.
Four Safeguards for Regression-Free Cross-Model Review
I apply four rules across my own repositories, all usable today with two plain terminals.
A Reviewer Without Conversation History or Author Identity
The reviewer receives the diff, the full modified files and the repository rules, never the conversation thread where the author justified its choices. If it reads the rationalization that led to the bug, it adopts the same mental frame. Hiding which model wrote the patch also avoids the label bias measured by Saraf et al.
Proven Findings Before Any Code Edit
A review finding is not an order to edit. Each remark must name the file, line, broken rule or failing scenario. The agent applying fixes checks every finding against the actual code and tests before writing anything, and drops any false or unreproduced claim.
On ReadIndexNowSnapshotQuery.php, this short schema forces the reviewer to prove the missing series_order key instead of commenting on file style:
{
"verdict": "changes_requested",
"findings": [
{
"severity": "P2",
"file": "app/Modules/Seo/Queries/ReadIndexNowSnapshotQuery.php",
"line": 49,
"rule": "The fingerprint tracks every field rendered on the page.",
"reproduction": "Swapping series_order on two articles with different dates leaves the hash unchanged."
}
]
}
Deterministic Checks Before and After Model Review
A static analyzer, a type checker, a formatter and a test suite decide without sycophancy and without run-to-run drift. Running them before review and after every fix clears out syntax and formatting errors and prevents the reviewer from approving a patch that breaks an existing test. That deterministic safety net is what blocks the regressions observed when a model less reliable in a given language edits another model's code.
A Bounded Review Loop With Human Escalation
Without an iteration cap, two agents bounce between styles or pile local patches onto code that needs a rewrite. Setting a short pass limit and routing any persistent disagreement or product choice back to the developer keeps review time and token cost predictable.
Bounded Cross-Review in Aubia
Automating this protocol without copy-pasting between terminals is why I am building Aubia. Each agent works in an isolated Git worktree so it never touches your main working copy. The handoff forwards the diff, modified files and repository rules from one provider to another without the author's conversation history, running on your own API keys (BYOK, for Bring Your Own Keys).
Cross-review runs as a bounded loop, set to three iterations by default (from one to ten in Settings), with a structured verdict that approves the diff, requests changes or rejects it. When a design problem has several serious approaches before a line of code is written, Opinions to Executable Plan Mode queries multiple agents on the same prompt, surfaces their convergences and divergences, and produces a plan before the first code edit.
Bounded, blind to the author and backed by deterministic checks, a second review complements your test suite and your final judgment on architecture by cutting down the number of silent bugs that reach you.
Aubia's beta is free, with no time limit. Sign up to receive your invitation.
Join the waitlist