TL;DR
VulContextBench is a new benchmark that shifts the evaluation of security-focused LLM agents from "did you get the right answer?" to "did you find the right evidence?" By auditing 111 vulnerability-introducing commits (VICs) and annotating them with "gold context," the researchers discovered a massive gap: while frontier models often encounter the necessary evidence during exploration, they frequently fail to include it in their final reports.
What Problem Does This Paper Address?
Current vulnerability-detection benchmarks typically use a binary "pass/fail" metric based on whether an agent correctly identifies a vulnerability. However, this approach has two major flaws:
- Memorization: LLMs are trained on vast amounts of public code and security advisories. An agent might correctly label a commit as vulnerable simply because it remembers the CVE from its training data, not because it actually "understood" the code.
- Label Noise: Many existing datasets rely on automated tools like V-SZZ to identify which commit introduced a bug. These tools are notoriously noisy, often pointing to commits that merely reformatted code rather than those that introduced the flaw.
The authors argue that for an agent to be truly useful in security triage, it must not only reach the right verdict but also provide the specific evidence (the "context") that justifies that verdict.
Methods
The researchers developed a rigorous three-step pipeline to build a high-quality benchmark:
- Task Pooling: They gathered candidate VICs from six existing datasets and added a new pool of recent vulnerabilities (from 2024-2026) to minimize the chance of model memorization.
- VIC Audit: Every candidate was manually audited against four strict criteria to ensure it was a "true" introducer: a real fix must exist, the commit must be the actual origin of the flaw, it must contain a substantive code change, and the vulnerability must be reachable by an attacker at that specific point in time.
- Gold Context Annotation: For the 111 cases that passed the audit, the authors created "gold context"—the specific lines of code needed to prove the vulnerability exists. This includes the core flaw, the "sink" (where the damage happens), reachability paths, and necessary dependencies.
To evaluate agents, they measured Precision, Recall, and F1 at three granularities: File (did they look at the right file?), Block (did they find the right function?), and Line (did they find the exact buggy lines?). Crucially, they scored agents twice: once on everything they viewed while exploring the repository, and once on what they actually declared as evidence in their final report.
Datasets
The resulting VulContextBench consists of:
- 111 audited VICs across 83 repositories.
- 63 distinct CWEs (Common Weakness Enumerations).
- 5 programming languages (C/C++, Java, JavaScript, Python, Go).
- 464 gold code blocks totaling over 13,000 lines of code.
Key Insights and Ideas
- The Retrieval-Reporting Gap: This is the paper's most significant finding. Agents are surprisingly good at finding the right code during exploration but struggle to select it for the final report. As shown in Figure 1, the models' performance "shrinks" significantly when moving from viewed context to declared evidence.
- Citing Files is Not Enough: High performance at the file level often masks failures at the block or line level. An agent might open the correct file but fail to isolate the specific function or lines that constitute the vulnerability.
- Supporting Evidence is Hard: Agents are relatively good at finding the "core" of a vulnerability (the VIC core) but much worse at identifying the supporting context, such as how an attacker reaches that code (reachability) or the configuration it depends on.
- Precision vs. Recall Trade-offs: Different models exhibit distinct "personalities." For example, Gemini 3.1 Pro prioritizes precision (citing less but being more accurate), while Kimi K3 explores aggressively, leading to higher recall but lower precision.
Key Results
The researchers evaluated seven frontier models, including GPT-5.5, Claude Opus 4.8, and Qwen3-Coder-Next.
- Massive Recall Drops: At the code block level, the share of gold context a model reports is 37 to 73 percentage points lower than the share it actually viewed.
- Qwen3-Coder-Next viewed 86.3% of the gold lines but cited a mere 12.9% in its final report.
- GPT-5.5 was the top performer in terms of declared evidence, viewing 73% of the gold context and reporting 36%.
- Verdict Accuracy vs. Context Retrieval: Interestingly, a model's ability to reach the correct binary verdict (vulnerable vs. not) does not always correlate with its ability to provide the correct evidence.
Limitations and Future Work
- Static vs. Dynamic: The benchmark currently relies on static code analysis and human-annotated gold sets. The authors suggest that a natural next step is "proof-of-concept execution," where reachability is confirmed by actually running an exploit rather than just reading the code.
- Selection Logic: The paper highlights that a gap exists between viewing and reporting, but it doesn't fully explore why models choose to discard relevant evidence. Future work could investigate better prompting or architectural changes to improve evidence selection.
- Agent Scaffolding: All models were tested using a specific agent harness (mini-SWE-agent). Results might vary with different agentic frameworks or toolsets.
Summary updated