LLM code reviewers miss up to 93% of vulnerabilities when prompts frame changes as safe
Confirmation bias in LLM-based code review lowers vulnerability detection and can be exploited in supply-chain attacks
Software arXiv 19 Mar 2026 Measurement Real-world evidence
Published as “Measuring and Exploiting Confirmation Bias in LLM-Assisted Security Code Review”
Why it matters
Deployers of LLM-assisted code review must treat metadata as a potential attack surface and consider automatic redaction or instruction-based debiasing to maintain vulnerability detection reliability.
Summary
Confirmation bias can cause LLM-based code review to miss real vulnerabilities; framing vulnerable code as secure reduces detection rates by up to 93.5 percentage points, and adversarial pull-request framing succeeds in 35% of cases against GitHub Copilot and 88% against Claude Code. The authors measured this with controlled experiments on 250 real CVE patches across four LLMs and with practical attack simulations on synthetic PRs. Debiasing via metadata redaction and explicit ignore-metadata instructions restores detection in all interactive cases and 94% of autonomous cases, showing the bias is mitigable but non-trivial.
What they found 2
- Bug-free framing drops GPT-4o-mini detection from 97.2% to 3.6%, a 93.5-point decline.
“GPT-4o-mini shows the largest effect, with detection falling from 240/247 (97.2%) under neutral framing to 9/247 (3.6%) under strong bug-free framing, a 93.5pp decline (h = 2.42, p < .001).”
- Adversarial framing succeeds in 35% of synthetic Copilot PRs.
“Adversarial framing succeeds in 12 cases (35.29%).”
Caveats 4
- False-positive rates change little, increasing by at most 13.6 percentage points, so bias does not dramatically raise spurious alerts.
- Under strong bug-free framing, precision appears higher but coverage is tiny: "GPT-4o-mini shows 88.9% TPR (8/9 detections correct), but this represents correctly identifying only 8 vulnerabilities out of 247 total (3.2% coverage)."
- We select GPT-4o-mini, Claude 3.5 Haiku, Gemini 2.0 Flash, and DeepSeek V3 for deployment realism rather than maximum capability.
- Given adequate infrastructure ... these failures likely stem from model or inference characteristics rather than hardware limitations. As a result, reliable analysis was not possible, highlighting limitations of locally deployed LLMs for structured security review tasks.
What’s new here 4
- Quantifies confirmation bias in LLM-based vulnerability detection for the first time.
- Shows an asymmetric effect where false-negative bias far exceeds false-positive bias.
- Demonstrates practical supply-chain exploitability of the bias against real-world tools (Copilot, Claude Code).
- Evaluates debiasing strategies (metadata redaction, explicit instructions) and provides deployment guidance.