← Blog

AI Model Comparisons

AI code review false positives: count real defects

November 24, 2026 · 5 min

AI code review false positives: count real defects

Your AI reviewer handed back eight findings. Some are real bugs, some are guesses, and some only hold under a condition nobody checked. The fix is simple: for each finding, ask for an input that breaks the code, then run that input yourself. A finding you can reproduce is a defect. A finding that needs an unchecked condition stays conditional. The length of the list tells you nothing.

Why is the number of findings a bad score?

Because one mistake can show up as five findings, and a confident guess looks the same as a proven bug.

Snyk's November 19, 2026 write-up scores code scanners on precision: distinct vulnerabilities found ÷ (distinct vulnerabilities found + distinct false positives). Note the word "distinct". Three inputs that hit the same boundary bug are one bug, not three.

A Hacker News thread puts the same frustration as a question: "If AI tools are so good, why isn't your bug backlog empty?" Part of the answer is that unverified findings pile up. Each one costs someone time to check.

What should the review prompt ask for instead?

Ask for demonstrated defects only, one counterexample each, and a minimal fix. Here is the exact prompt we used:

Review this toy Python download handler. Assume root=/srv/files and an untrusted name. Code: p=os.path.join(root,name); assert p.startswith(root); return open(p,'rb').read(). Report only demonstrated path-validation defects; give one counterexample per defect and a minimal fix. Do not invent surrounding authentication or deployment details.

The last sentence matters. Without it, a model can invent a login layer or a server config and then "find" problems in code you never gave it. If you're asking for a patch to a bigger file, add a do-not-touch list too, so the fix doesn't quietly change something else.

What happened when three models reviewed the same check?

On November 23, 2026 we sent that prompt to Gemini 4 Argon, Claude Sonnet 5.5 and GPT-6.1 Sol side by side in EVA's Multi Chat. All three found the two real defects: path traversal (../) and the sibling-directory prefix (/srv/files2 passes a check for /srv/files). Where they differed was in what they treated as conditional, and in the fix.

ModelReal defects shownConditional findingsProposed fix
Gemini 4 ArgonTraversal, sibling prefixSymlink, stated as "If a symlink exists inside /srv/files"commonpath, but still inside an assert
Claude Sonnet 5.5Traversal, sibling prefix-O example, stated as conditionalrealpath + commonpath, raises PermissionError
GPT-6.1 SolTraversal, sibling prefix-O example, "conditional on optimization, not a claim about the deployment"abspath + commonpath, raises ValueError (doesn't handle symlinks)

This is one test of one toy snippet, not a ranking. We didn't measure separate response times, credit use, internal model versions or search settings. Sol's answer included source links, so we can't claim the tool conditions were identical.

Gemini 4 Argon's response in EVA: traversal, a sibling-directory prefix, and a conditional symlink example

Claude Sonnet 5.5's response in EVA: path examples, the -O condition, and a fix that raises an exception

GPT-6.1 Sol's response in EVA: a path defect kept separate from the conditional -O example

The detail worth slowing down for is the fix. Argon's patch keeps the check inside assert. That leads straight to the next question.

Which findings were conditional, and why does that matter?

The Python docs on assert say the compiler emits no code for an assert statement when optimization is requested (-O). So a check written as assert disappears under -O. That's a real risk, but only if the code runs with -O. Sonnet and Sol said so plainly. That's the right way to report it: name the condition, don't present it as a fact about your deployment.

The symlink case works the same way. Argon only claimed it if a link already exists inside the root. We didn't count it as a false alarm, and we didn't count it as a proven defect either. It stays in the "conditional" column until someone tests it.

How do you check a counterexample yourself?

Check the decision, not the file. You don't need to open /etc/passwd to prove the check is wrong. You only need to show that an outside path passes it.

This is the script we ran. It never opens a system file:

import os, subprocess, sys

root = '/srv/files'
for name in ['../../etc/passwd', '/srv/files_secret/key.pem',
             '/srv/files2/secret', '../secret', '/srv/files_backup/secret']:
    p = os.path.join(root, name)
    outside = os.path.commonpath([root, os.path.abspath(p)]) != root
    print(name, 'passes startswith:', p.startswith(root), '| outside root:', outside)

# The -O case, using a marker instead of a real file read
code = "p='/etc/passwd'; assert p.startswith('/srv/files'); print('REACHED_OPEN')"
print('normal:', subprocess.run([sys.executable, '-c', code], capture_output=True, text=True).returncode != 0)
print('-O:', subprocess.run([sys.executable, '-O', '-c', code], capture_output=True, text=True).stdout.strip())

All five strings passed startswith and landed outside the root once normalized. Under normal Python the assert rejected /etc/passwd. Under -O the code reached the marker where the file would have been opened.

Two notes from the os.path docs explain why. commonpath compares whole path components, so /srv/files2 doesn't count as inside /srv/files. A raw string prefix does. And realpath resolves symlinks, while abspath doesn't, so the two fixes above aren't interchangeable.

This is a check of the claim, not a security audit. We didn't run the symlink case, and race conditions were out of scope. Before you merge any fix, add regression tests for the inputs you just proved.

How should you record the result?

Use three columns instead of a count:

  • Demonstrated defect: you ran the counterexample and it broke the check.
  • Conditional risk: it depends on something you haven't confirmed (a flag, a symlink, a config). Write the condition in the issue title.
  • False alarm: you tested the exact claim and it didn't hold.

If you can't reproduce something yet, leave it open and write down what's missing. "Couldn't reproduce" isn't the same as "false positive". For the wider workflow around this, see the multi-model code review guide.

FAQ

Did the test compare speed?

No. Separate response times weren't measured, so there's no speed comparison here.

Were the three models run under identical settings?

We can't say that. Internal versions and search settings weren't measured, and Sol's answer included source links.

Does a correct counterexample mean the fix is safe?

No. It proves the original check is wrong. The fix still needs its own tests, and a symlink-aware fix (realpath) behaves differently from one that only normalizes the string (abspath).

Run the same counterexample prompt across models in EVA, then run the counterexamples yourself.

Try EVA free

We count visits anonymously, without cookies. Accept to also allow analytics cookies, session recordings, and limited sharing with Google to measure our ads. Our analytics never collect the content of your chats. Privacy Policy · Your Privacy Choices