Dev.to AI 🤖 Ai 👁 0 📖 6 min read

I Planted 20 Bugs for Three AI Reviewers. Being Right Wasn't Enough.

Reviewer Planted bugs caught (of 20) False alarms (of 20 clean functions) ChatGPT 20 0 Grok (possible contamination: same account as the key reviewer) 20 0 DeepSeek V4 Pro 17 0 llama3 8B (local) no answer no an

Reviewer Planted bugs caught (of 20) False alarms (of 20 clean functions)
ChatGPT 20 0
Grok (possible contamination: same account as the key reviewer) 20 0
DeepSeek V4 Pro 17 0
llama3 8B (local) no answer no answer

That is round 1 of a small test I ran this week. I wanted to know which AI reviewer I should trust to check changes to my agents, so I stopped asking them and started measuring them.

The setup

My coding agent, Claude, wrote 40 short Python functions, each with a plain-English spec. Twenty were correct. Twenty had exactly one planted bug, in five kinds: an off-by-one boundary, a wrong comparison, a bad fallback, a quiet change to what the spec asks for, and a wrong default. For every buggy function it kept a hidden copy with the bug fixed.

Each reviewer got the same instruction and the same 40 functions in a fresh session, with no hints about how many were broken. For every function it had to answer OK or DEFECT. A DEFECT also needed a concrete input where the function breaks its spec.

How each one ran, as recorded:

  • ChatGPT: web Temporary Chat, set to Unpersonalized, reasoning High. The exact model name was not shown.
  • Grok: web Private chat, Expert mode. I found no memory setting to turn off.
  • DeepSeek V4 Pro: one call through an agent tool with every tool disabled, not a direct API call.
  • llama3 8B: local, through ollama. Three attempts, no answer.

A catch has to be proven

This is the rule that matters. A reviewer's explanation is saved and never scored. What gets scored is the input they gave: we run it through the buggy function and through the fixed copy. If the two behave differently, the reviewer caught the bug. If they behave the same, the reviewer said DEFECT for a reason their own evidence does not show.

Here is a simplified version of that check:

def outcome(fn, args):
    try:
        return ("value", fn(*args))
    except Exception as e:
        return ("raise", type(e).__name__)

def same(x, y):
    if x[0] != y[0]:
        return False
    a, b = x[1], y[1]
    if isinstance(a, float) and isinstance(b, float) and a != a and b != b:
        return True   # NaN never equals itself; treat two NaNs as the same result
    return a == b

def judge(answer, item, reference, has_bug):
    if not isinstance(answer, dict):
        return "invalid"
    if answer.get("verdict") not in ("OK", "DEFECT"):
        return "invalid"
    if answer["verdict"] == "OK":
        return "missed" if has_bug else "ok"
    args = answer.get("failing_input")
    if not isinstance(args, list):
        return "invalid"
    if not has_bug:
        return "false_alarm"   # any DEFECT on correct code is a false alarm
    different = not same(outcome(item, args), outcome(reference, args))
    return "caught" if different else "wrong_reason"

On a correct function there is nothing to fix, so any DEFECT on it is a false alarm. The real scorer also adds a timeout, compares floats with a tolerance (including inside lists), and rejects code outside an allowed subset of Python before running anything. It is not a sandbox.

One assumption sits under all of this: the hidden fixed copy is treated as the truth. A demonstrated difference counts as a catch within the test's own rules. It is not independent proof that the fixed copy itself is correct, which is why every function was reviewed against its spec before the test was sealed. And a difference is only meaningful when the input falls within what the spec allows; this scorer does not check that, so a reviewer could in principle earn a catch with an input the spec never covered.

Right words, no proof

One function, get_nested, follows a list of keys through nested dicts and should return None when a key is missing. The planted bug returned the half-finished value instead.

All three reviewers flagged it, and all three explanations were right. ChatGPT and Grok gave the input [{"a": 1}, ["b"]]. The buggy version returns {"a": 1}, the fixed one returns None. Caught.

DeepSeek wrote: "On a missing key it returns the partially-traversed dict instead of None." Correct. But its input was [{"a": 1}, ["a", "b"]]. On that input the code reaches 1["b"], which raises a TypeError, and both versions return None. Same output, so no catch.

If I had scored explanations, DeepSeek gets that one. Scoring the evidence, it doesn't. That gap is the whole reason the test runs the input instead of reading the sentence.

DeepSeek's other two misses: it called one buggy function correct, and on another it wrote Python's None instead of JSON's null, so that single answer could not be read. The other 39 of its answers were still scored.

These scores use cleaned captures: copy and paste escapes were removed from ChatGPT's response, and a launcher warning line from DeepSeek's. Answer values were preserved, and invalid answer content stayed invalid.

What this result does not say

It does not say ChatGPT and Grok are equal, or perfect. This round didn't separate the two highest-scoring sessions. Bugs that were too easy is one explanation; for Grok's row, possible contamination is another. On 20 bugs, the 95% Wilson interval for a perfect score runs from 84% to 100%, and DeepSeek's 17 of 20 (64% to 95%) overlaps it.

One model wrote every bug. The functions are short and use only builtins. Nothing here measures review of real agent code, with state, timing and network payloads.

The local model never answered. llama3 8B on my 8 GB MacBook Air pushed the machine into swap so hard the laptop slowed to a crawl. My last attempt measured about 4 bytes every 90 seconds, a projection of roughly 37 hours for one complete answer. It is recorded as no answer on all 40.

Grok's memory state is unknown. The AI that reviewed the answer key before it was sealed is also Grok, on the same account. The Grok reviewer ran in a private chat, but if Grok's memory crosses chats, its 20 of 20 could be contaminated. I can't rule that out from here.

What does hold: across 60 checks of correct code, none of the three raised a false alarm. On this set, when they said "bug," there was one.

Constraining the planter's influence over the grading

The agent that planted the bugs knew the answers, so it never graded. Encryption can't erase what the planter already knows. It restricts access to the saved key; comparing files against the recorded fingerprints makes later changes detectable. Independent review covers the rest.

The answer key was encrypted with a passphrase only I typed, and it stayed locked until the three completed responses and the local model's no-answer record were locked. Before any reviewer saw the test, the fingerprints of the key, the functions, the instruction and the scorer were written down on paper and logged. After the answers arrived and before the key was opened, every answer file was fingerprinted too.

A second AI, from a different company than the one that planted the bugs, tried to break the scorer before it ran. After the answers arrived, one of them turned out to contain a single unreadable row, so the scorer's answer reader had to change. The second AI broke the first version of that change: one malformed answer shape could keep a wrong verdict, and another could silently drop a row. The reader was rebuilt, the second attempt to break it did not land, and the new scorer's fingerprint was logged before the key was opened.

Round 2

Round 2 is already sealed: 40 new functions, longer, with bugs that often show only when two conditions meet, like page counts that divide exactly or intervals that touch without overlapping. The AI that checks the work blocked the question set three times before it was sealed, including one "correct" function that accepted Arabic-Indic digits in an IP address. Results go up when the reviewers finish.

If you've measured AI code review yourself: how did you keep the reviewer's explanation from getting credit its evidence didn't earn?

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.