A few weeks ago I published a benchmark for the AI code reviewer I build. Take ten commits that fixed real CVEs, revert each one, run the reviewer on the diff, see whether it names the right bug. It found all ten, and I wrote four paragraphs explaining why that number was close to worthless.
Then a reader left a comment that was better than my four paragraphs. His point: a reverted security fix is a diff that deletes a guard clause. If your reviewer is pattern-matching on "a check disappeared", it will flag that shape regardless of whether the original commit was fixing a CVE. The ground truth is doing none of the work.A few weeks ago I published a benchmark for the AI code reviewer I build. Take ten commits that fixed real CVEs, revert each one, run the reviewer on the diff, see whether it names the right bug. It found all ten, and I wrote four paragraphs explaining why that number was close to worthless.
Then a reader left a comment that was better than my four paragraphs. His point: a reverted security fix is a diff that deletes a guard clause. If your reviewer is pattern-matching on "a check disappeared", it will flag that shape regardless of whether the original commit was fixing a CVE. The ground truth is doing none of the work.
He gave a design for the control I should have run first: for each of the ten cases, revert a non-security commit of similar size in the same repo, and run the same reviewer with the same settings. If it flags many of those, 10/10 doesn't measure vulnerability detection. It measures noticing deletions.
I ran it. This post is about the experiment design, because I think that part generalizes beyond my tool.
The setup
Ten control commits, one per original case, matched on:
- same repository
- same source file where the file had enough history
- an already merged commit with a non-security subject
- comparable diff size
- identical treatment: check out the commit,
git revert --no-commit, restore docs/tests, commit, run only the security agent againstHEAD~1with no PR description and no commit message
Matching "the same file, similar size, same year" was not always possible. Three controls are years away from their fix in repository time. Two are mostly documentation changes, which are trivially quiet. One control is a sixth of the size of its fix. I published the table with all of that visible rather than picking the matched ones that looked good.
What the control showed
7 of 10 controls produced complete silence. 3 produced comments. All three were noise for a security review.
The cheap version of the criticism doesn't hold: the reviewer was not flagging every reverted commit. It stayed quiet on seven of ten ordinary reverts while hitting ten of ten CVE reverts. Something in the security patches is being detected.
But the three comments are more useful than a clean zero, because all three share one failure mode, and it is not hallucination:
the reviewer describes the reverted change correctly, then promotes an ordinary robustness bug to a security vulnerability.
Three cases, three projects, three different agents' worth of surface area — Django, axios, lodash. In each one the code observation held up when I checked it against the diff. What did not hold up was the severity argument layered on top: a TypeError on a malformed custom FormData became "could crash the Node.js process", an equality bug in _.isEqual became an authentication bypass path that does not exist in that codebase.
I am deliberately not walking through all three here. The full write-up with the commits, the diffs and what each project actually did about them is linked at the bottom; the point for this post is the shape of the failure, not the individual findings.
The shape matters because it is fixable in a way that hallucination is not. A model that invents a function that does not exist cannot be prompted out of it. A model that reads the diff correctly and then over-claims significance can be constrained: require a concrete failure path, require a line anchor, and let "no comment" be an acceptable output. That is what the next version does, and the control is what told me it needed to.
All three also had file: null, and one had a line number of 56375802. I had claimed in an earlier post that anchoring every finding to a specific line was one of the design fixes. On these runs it plainly was not enforced — the fix existed in the code and not in the behaviour.
The thing I found while setting up the control
To keep the two runs comparable I opened the original ten log files, and found this in all of them:
SecurityAgent: rate-limited by provider for diff:HEAD~1, retrying: Error code: 429 - inference exceeds tpm/rpm limit Every one of the ten original cases had hit a rate limit on the primary model and fallen back to a cheaper one. The published 10/10 was a fallback-model result, not a result for the model I had configured. I did not notice when I published it.
This is the part I keep coming back to. The fallback messages were in my own logs the entire time. Nobody read them, because the run had "succeeded" — it exited cleanly, wrote a report, and reported ten catches. A run that succeeds via a path you did not intend looks exactly like a run that succeeded.
Two things I'd now do differently
1. A matched control is not optional, and it costs about as much as the experiment.
The ten CVE cases took a day. The control took another day, and invalidated more than it confirmed. If you publish a detection rate without a control of the same shape, the number measures your dataset, not your tool. The control is not a nicety you add when a reviewer complains — it is the thing that tells you whether your headline number means anything.
2. Logs are part of the experiment, and "it succeeded" is not a result.
The model that actually ran is a property of the experiment, as much as the prompt and the input. I now check the provider and model that produced each run before I write down any number. That is a boring check that takes thirty seconds and would have saved me a public correction.
What the numbers do and do not support
Being precise about this matters more than the result:
- 4 comments across 20 ordinary commits is an anecdote with a table. You cannot compute a precision rate from it, and I don't.
- One project, one language.
psf/requestsis Python, small, and unusually well reviewed. A codebase with more security surface will produce more comments, not fewer. - I graded "noise" myself, knowing what each diff was supposed to do — which a reviewer in CI does not. The grading is generous, not strict.
- Ten cases is a sample where adding two moves the headline twenty points. There is no confidence interval worth printing at that size.
What it does support: on ordinary changes the reviewer is quiet, and when it does speak on a clean diff, the failure is not random hallucination. It is a correct observation wrapped in an inflated conclusion. That's a fixable failure mode — it became the confidence floor and the line-anchoring requirement in the next version — but it is a failure mode I only know about because I ran the control.
If you're evaluating any reviewer
Short list, whether you use mine or someone else's:
- Ask for the false positive rate on clean pull requests, not the number of bugs found. Almost nobody has that number.
- Ask whether the eval strips the answer key — release notes, tests, commit messages. If it doesn't, you're measuring the model's ability to read.
- Read the finding text, not the severity label. Ask whether you'd have shipped the code after reading it.
- Ask how many cases. Under thirty is a story, not a benchmark.
If you want to break mine, the method is written down and the raw runs are in the repo. The full write-ups, including the parts that make us look bad:
- The noise measurement on 20 ordinary commits
- The matched control, and the correction
- The benchmark and its own limitations
To reproduce the setup without installing anything: pip install revhive-ai, then revhive demo (canned data, no API key — it shows the report format, not review quality). A real review needs your own key: revhive review --file <path>.
He gave a design for the control I should have run first: for each of the ten cases, revert a non-security commit of similar size in the same repo, and run the same reviewer with the same settings. If it flags many of those, 10/10 doesn't measure vulnerability detection. It measures noticing deletions.
I ran it. This post is about the experiment design, because I think that part generalizes beyond my tool.
The setup
Ten control commits, one per original case, matched on:
- same repository
- same source file where the file had enough history
- an already merged commit with a non-security subject
- comparable diff size
- identical treatment: check out the commit,
git revert --no-commit, restore docs/tests, commit, run only the security agent againstHEAD~1with no PR description and no commit message
Matching "the same file, similar size, same year" was not always possible. Three controls are years away from their fix in repository time. Two are mostly documentation changes, which are trivially quiet. One control is a sixth of the size of its fix. I published the table with all of that visible rather than picking the matched ones that looked good.
What the control showed
7 of 10 controls produced complete silence. 3 produced comments. All three were noise for a security review.
The cheap version of the criticism doesn't hold: the reviewer was not flagging every reverted commit. It stayed quiet on seven of ten ordinary reverts while hitting ten of ten CVE reverts. Something in the security patches is being detected.
But the three comments are more useful than a clean zero, because all three share one failure mode, and it is not hallucination:
the reviewer describes the reverted change correctly, then promotes an ordinary robustness bug to a security vulnerability.
Three cases, three projects, three different agents' worth of surface area — Django, axios, lodash. In each one the code observation held up when I checked it against the diff. What did not hold up was the severity argument layered on top: a TypeError on a malformed custom FormData became "could crash the Node.js process", an equality bug in _.isEqual became an authentication bypass path that does not exist in that codebase.
I am deliberately not walking through all three here. The full write-up with the commits, the diffs and what each project actually did about them is linked at the bottom; the point for this post is the shape of the failure, not the individual findings.
The shape matters because it is fixable in a way that hallucination is not. A model that invents a function that does not exist cannot be prompted out of it. A model that reads the diff correctly and then over-claims significance can be constrained: require a concrete failure path, require a line anchor, and let "no comment" be an acceptable output. That is what the next version does, and the control is what told me it needed to.
All three also had file: null, and one had a line number of 56375802. I had claimed in an earlier post that anchoring every finding to a specific line was one of the design fixes. On these runs it plainly was not enforced — the fix existed in the code and not in the behaviour.
The thing I found while setting up the control
To keep the two runs comparable I opened the original ten log files, and found this in all of them:
SecurityAgent: rate-limited by provider for diff:HEAD~1, retrying: Error code: 429 - inference exceeds tpm/rpm limit Every one of the ten original cases had hit a rate limit on the primary model and fallen back to a cheaper one. The published 10/10 was a fallback-model result, not a result for the model I had configured. I did not notice when I published it.
This is the part I keep coming back to. The fallback messages were in my own logs the entire time. Nobody read them, because the run had "succeeded" — it exited cleanly, wrote a report, and reported ten catches. A run that succeeds via a path you did not intend looks exactly like a run that succeeded.
Two things I'd now do differently
1. A matched control is not optional, and it costs about as much as the experiment.
The ten CVE cases took a day. The control took another day, and invalidated more than it confirmed. If you publish a detection rate without a control of the same shape, the number measures your dataset, not your tool. The control is not a nicety you add when a reviewer complains — it is the thing that tells you whether your headline number means anything.
2. Logs are part of the experiment, and "it succeeded" is not a result.
The model that actually ran is a property of the experiment, as much as the prompt and the input. I now check the provider and model that produced each run before I write down any number. That is a boring check that takes thirty seconds and would have saved me a public correction.
What the numbers do and do not support
Being precise about this matters more than the result:
- 4 comments across 20 ordinary commits is an anecdote with a table. You cannot compute a precision rate from it, and I don't.
- One project, one language.
psf/requestsis Python, small, and unusually well reviewed. A codebase with more security surface will produce more comments, not fewer. - I graded "noise" myself, knowing what each diff was supposed to do — which a reviewer in CI does not. The grading is generous, not strict.
- Ten cases is a sample where adding two moves the headline twenty points. There is no confidence interval worth printing at that size.
What it does support: on ordinary changes the reviewer is quiet, and when it does speak on a clean diff, the failure is not random hallucination. It is a correct observation wrapped in an inflated conclusion. That's a fixable failure mode — it became the confidence floor and the line-anchoring requirement in the next version — but it is a failure mode I only know about because I ran the control.
If you're evaluating any reviewer
Short list, whether you use mine or someone else's:
- Ask for the false positive rate on clean pull requests, not the number of bugs found. Almost nobody has that number.
- Ask whether the eval strips the answer key — release notes, tests, commit messages. If it doesn't, you're measuring the model's ability to read.
- Read the finding text, not the severity label. Ask whether you'd have shipped the code after reading it.
- Ask how many cases. Under thirty is a story, not a benchmark.
If you want to break mine, the method is written down and the raw runs are in the repo. The full write-ups, including the parts that make us look bad:
- The noise measurement on 20 ordinary commits
- The matched control, and the correction
- The benchmark and its own limitations
To reproduce the setup without installing anything: pip install revhive-ai, then revhive demo (canned data, no API key — it shows the report format, not review quality). A real review needs your own key: revhive review --file <path>.