LLMs change vulnerability verdicts due to cognitive heuristics, enabling up to 97% suppression
LLM-based vulnerability detectors are influenced by halo, framing, and anchoring cues, leading to altered safety judgments
AI/ML arXiv 29 Jun 2026 Measurement Prototype evidence
Published as “Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection”
Why it matters
LLM-based code scanners can be misled by innocuous metadata, threatening their reliability as automated security gatekeepers in CI/CD pipelines.
Summary
Cognitive heuristics in non-code context cause LLM vulnerability detectors to change their recall and false-positive rates, with framing having the largest impact and halo/anchoring also significant. The biases do not improve detection accuracy; they merely shift the model’s willingness to flag code, and can be exploited to suppress up to 97% of previously detected vulnerabilities in a CI/CD workflow. The evidence comes from a controlled experiment on eight LLMs across three languages, measuring recall and FPR changes under varied contextual prompts.
What they found 2
- Framing produces the strongest and most consistent effect, with every model responding as expected.
“Framing is the strongest and most consistent effect in our study. Every model responds in the expected direction.”
- Cognitive biases can be leveraged to hide almost all previously found vulnerabilities in a realistic CI/CD scenario.
“Finally, cognitive biases can be exploited to suppress up to 97% of previously detected vulnerabilities in a realistic CI/CD threat model.”
Caveats 2
- A few open-source models (e.g., LLaMA 3.3) achieve a positive utility shift under certain framing variants, contradicting the claim that heuristics never improve detection.
- Claude shows near-zero net halo effect because opposing influences cancel out, indicating that the overall bias magnitude can be negligible for some models.
What’s new here 4
- Systematically evaluates how non-code metadata (author, framing, prior verdict) influences LLM security verdicts.
- Quantifies three cognitive heuristics (halo, framing, anchoring) across multiple models and languages.
- Shows both constructive and adversarial effects, including a proof-of-concept attack that suppresses detections.
- Provides a fine-grained analysis of heuristic impact on different CWE categories.