# LLM agents patch security bugs, pass all tests, but still leave the vulnerability open [R] — retained record

> Retained reddit record from reddit:MachineLearning.

Canonical: https://highsignal.app/data/records/0d3e070a2b33f096

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:MachineLearning)  published 2026-06-02 08:38 ingested 2026-06-02 10:07

[original source ↗](https://www.reddit.com/r/MachineLearning/comments/1tukvjt/llm_agents_patch_security_bugs_pass_all_tests_but/)

## extract

<table> <tr><td> <a href="https://www.reddit.com/r/MachineLearning/comments/1tukvjt/llm_agents_patch_security_bugs_pass_all_tests_but/"> <img alt="LLM agents patch security bugs, pass all tests, but still leave the vulnerability open [R]" src="https://preview.redd.it/g29hj3ndzt4h1.png?width=140&amp;height=89&amp;auto=webp&amp;s=3a5e47d1059b68a9fd4964f32b4cd2f7b26d7658" title="LLM agents patch security bugs, pass all tests, but still leave the vulnerability open [R]" /> </a> </td><td> <!-- SC_OFF --><div class="md"><p>I built CVE-Bench: 20 real-world CVEs across 18 Python projects (Pillow, GitPython, yt-dlp, urllib3, others), 5 frontier models, 3 prompt conditions, 300 runs total. Each agent runs in a sandboxed container and is scored against a hidden <code>test_security.py</code> derived from the maintainer's own fix. Binary pass/fail (a 90%-patched vulnerability is still a vulnerability).</p> <p>To better understand failure modes, I've tested <strong>three prompt conditions</strong>: </p> <ul> <li><em>advisory</em> (full GHSA report), </li> <li><em>diagnose</em> (exploit description only, no file or function), and </li> <li><em>locate</em> (exact file and function, no description of the flaw).</li> </ul> <p>The three conditions test meaningfully different things. A model that does well on advisory but drops on diagnose can’t translate a behavioral description into a location in the codebase. A model that holds up on locate is recognizing dangerous code on its own.</p> <p><strong>The leaderboard isn't the finding.</strong> Best solve rate is 50% overall, 60% under advisory. Cross-family separation (OpenAI vs Laguna) is confirmed under McNemar's test with continuity correction (all four pairs cross α = 0.05). Within-family gaps are noise: a power analysis puts the task count needed to detect a meaningful within-family edge at ~700. That cuts both ways: if the expensive models had a large true advantage, 20 tasks would have been enough to surface it. gpt-5.5 at 12× the cost of gpt-5.4-mini is not the rational choice.</p> <p><a href="https://preview.redd.it/g29hj3ndzt4h1.png?width=1077&amp;format=png&amp;auto=webp&amp;s=472b6f5f10d946c6e72205e53e8e9f0076244049">All four cross-family pairwise comparisons reach statistical significance at α = 0.05 (McNemar test with continuity correction, n = 60 tasks per model pair): gpt-5.5 vs laguna-m.1 (p = 0.015), gpt-5.4-nano vs laguna-m.1 (p = 0.017), gpt-5.5 vs laguna-xs.2 (p = 0.028), gpt-5.4-nano vs laguna-xs.2 (p = 0.040). Within-family comparisons remain far from significance; those rankings should be read as approximate.</a></p> <p><strong>The failure taxonomy is the most interesting finding.</strong></p> <ul> <li><strong>Wrong-search drift</strong> — model finds the right file early, makes one incorrect inference, spends the remaining turns chasing it. Budget expires, no edit made.</li> <li><strong>Budget exhaustion mid-implementation</strong> — correct diagnosis, scaffolding added, fix never wired in. Understanding present but model took too long to get to the point.</li> <li><strong>Correct file, wrong gadget</strong> — coherent edit, all regression tests green, vulnerability still present. Nothing in the output signals the problem.</li> </ul> <p>That last one is the operationally dangerous case. It's indistinguishable from a correct fix without the hidden test.</p> <p><a href="https://preview.redd.it/91qglevrzt4h1.png?width=1227&amp;format=png&amp;auto=webp&amp;s=52cc3a98f2a7a0c407c040bc2b707d9697917665">How runs end. Outcome breakdown per model across all 60 runs. The larger \&quot;no edit attempted\&quot; share for gpt-5.5 and laguna-m.1 shows models that deliberated and gave up. The elevated regression bars for nano, laguna-m.1, and laguna-xs.2 show models that patched too aggressively.</a></p> <p><strong>The locate condition is the sharpest tool.</strong> Strip the advisory, give only file and function (no description of the flaw, no attack scenario). Every model drops. gpt-5.5 and gpt-5.4-nano drop least (by 2 solves each). No model reads unfamiliar code cold and reliably identifies what's wrong. That's the capability gap the aggregate solve rate doesn't surface.</p> <p><a href="https://preview.redd.it/h4shjwe00u4h1.png?width=937&amp;format=png&amp;auto=webp&amp;s=4b2c438c2e1781c190a9cfc46b6d3b709f5405d0">More tokens does not mean more solves. Each dot is one run; colour shows outcome (green = solved, orange = regression, red = failed). The Laguna models consume 3–4× more tokens than OpenAI models of equivalent capability, driven by longer, less decisive runs.</a></p> <p>More tokens does not mean more solves. The Laguna models consume 3–4× more tokens than OpenAI models of equivalent capability, driven by longer, less decisive runs.</p> <p>Caveats: all CVEs post-training-cutoff but contamination isn't fully eliminable. Task set skews toward compact, self-contained patches (no protocol-level changes, no multi-service fixes). Per-class solve rates (injection 33%, DoS 24%, XSS/CSRF 20%, info-disclosure 0%) are directional signals, not powered estimates.</p> <p>Full write-up, tasks, and result traces: <a href="https://giovannigatti.github.io/cve-bench">https://giovannigatti.github.io/cve-bench</a> </p> <p>Code: <a href="https://github.com/GiovanniGatti/cve-bench">https://github.com/GiovanniGatti/cve-bench</a></p> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/Fickle-Box1433"> /u/Fickle-Box1433 </a> <br /> <span><a href="https://www.reddit.com/r/MachineLearning/comments/1tukvjt/llm_agents_patch_security_bugs_pass_all_tests_but/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/MachineLearning/comments/1tukvjt/llm_agents_patch_security_bugs_pass_all_tests_but/">[comments]</a></span> </td></tr></table>

## retained text

No document body was retained for this record — only its metadata was stored.
