NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SEC-bench: Automated Benchmarking of LLM Agents on Real-World Software Security Tasks

Hwiwon Lee, Ziqi Zhang, Hanxiao Lu, Lingming Zhang

TL;DR

SEC-bench is the first fully automated benchmarking framework designed to evaluate LLM agents on authentic, real-world software security tasks like proof-of-concept (PoC) exploit generation and vulnerability patching. By leveraging a novel multi-agent verification system, the framework automatically curates high-quality, reproducible vulnerability datasets at a fraction of the cost of manual curation ($0.87 per instance). Testing state-of-the-art LLM code agents on this benchmark reveals a massive performance gap, with top models achieving at most an 18.0% success rate in generating exploits and 34.0% in patching them.

What Problem Does This Paper Address?

While large language models (LLMs) have made staggering progress on general software engineering benchmarks—with success rates on SWE-bench soaring from under 2% to over 60% in recent years—software security has remained a notoriously difficult frontier to benchmark.

Existing cybersecurity benchmarks suffer from two main flaws: they either rely on artificial, simplified Capture-The-Flag (CTF) challenges, or they use static vulnerability datasets that lack a reliable verification process. Real-world security engineering is messy. Bug reports lack a common schema, vulnerabilities are highly environment-sensitive (failing to reproduce without exact compiler flags or library versions), and public exploits are frequently incomplete or broken.

To truly evaluate if LLM agents can act as autonomous security engineers, researchers need a scalable, automated way to collect real-world vulnerabilities, reproduce them deterministically, and test agents against them in isolated environments.

Methods

SEC-bench solves the benchmark generation problem by introducing an automated pipeline consisting of three core modules:

  1. Preprocessor: Collects CVE instances from public databases, scrapes heterogeneous bug reports across various tracking platforms, and constructs customized Docker environments with project-specific dependencies.
  2. Verifier (SECVERIFIER): A specialized multi-agent framework that orchestrates four distinct LLM agents to reproduce and validate the vulnerability:
  3. Manager Agent: Coordinates tasks and evaluates outputs against predefined objectives.
  4. Builder Agent: Resolves compilation errors and configures the build environment.
  5. Exploiter Agent: Extracts or constructs a functional PoC input.
  6. Fixer Agent: Isolates vulnerability-related modifications to synthesize a unified patch.
  7. Evaluator: Packages successfully verified instances into secure, containerized Docker images to test external LLM agents on two distinct tasks: PoC Generation (given a bug description, trigger the vulnerability) and Vulnerability Patching (given a bug description and a PoC, fix the code).

Crucially, SEC-bench uses memory safety sanitizers (like AddressSanitizer) as an objective, deterministic oracle. A PoC is only valid if it triggers the expected sanitizer report, and a patch is only valid if that report disappears without breaking the project build.

Figure 1: Overview of SEC-bench.

Datasets

The authors introduced the SEC-bench dataset, starting from a seed pool of 38,201 potential CVE instances across 7,926 open-source projects. After automated filtering and multi-agent verification, they successfully produced 200 verified real-world CVE instances spanning 29 critical C/C++ open-source projects (such as imagemagick, gpac, and php).

Compared to general software engineering benchmarks like SWE-bench, SEC-bench instances feature significantly longer issue descriptions (averaging 921.1 words due to detailed crash logs and call stacks) but smaller, more precise code fixes (averaging 17.3 lines edited).

Table 2: Statistics of SEC-bench task instances showing average and maximum values for key attributes. Values represent micro-averages across all instances without repository-level grouping.

Key Insights and Ideas

  • Multi-Agent Scaffolding is Superior for Curation: The multi-agent SECVERIFIER achieved a 26.0% overall success rate in reproducing and verifying raw CVEs, outperforming a state-of-the-art single-agent baseline (CODEACT) by 85.7% (relative improvement) while keeping costs remarkably low ($0.82 vs $0.72 per instance).
  • Security Requires Continuous Codebase Analysis: Trajectory analysis showed that unlike general software engineering tasks—where agents move linearly from localization to editing to submission—security tasks force agents to continuously re-read files and execute bash commands throughout the entire lifecycle to trace complex data flows.
  • The Byte-Level Reasoning Gap: LLMs struggle immensely with PoC generation because memory-access violations require precisely crafted, byte-level payloads. Text-trained LLMs lack the low-level reasoning required to understand runtime memory layouts.
  • The Debugger Bottleneck: Current LLM agents operate blindly without dynamic debugging tools (like GDB). Without the ability to step through execution and inspect runtime states, agents resort to inefficient trial-and-error.

Key Results

The authors evaluated leading code agents (SWE-agent, OpenHands, and Aider) powered by frontier models (Claude 3.7 Sonnet, GPT-4o, and o3-mini).

  • PoC Generation is the Hardest Task: On the complete dataset, the absolute highest success rate achieved by any agent configuration was just 18.0%.
  • Vulnerability Patching is Marginally Better: The best-performing agent configuration topped out at a 34.0% success rate.
  • Claude 3.7 Sonnet Leads the Pack: Across both tasks, Claude 3.7 Sonnet consistently outperformed GPT-4o and o3-mini when paired with advanced agent scaffolds like SWE-agent and OpenHands.
Table 4: Overall performance of code agents on PoC generation and vulnerability patching tasks across different LLMs and agent scaffolds, evaluated on 80 instances from 13 projects.

Limitations and Future Work

SEC-bench currently focuses exclusively on C/C++ projects and memory safety vulnerabilities. This was a deliberate design choice to ensure objective, deterministic verification via sanitizers. However, it leaves out massive classes of vulnerabilities, such as logical flaws in web applications, concurrency bugs, or kernel-level exploits.

The authors note that future iterations of SEC-bench could expand to languages like Java, Python, Go, and Rust by integrating language-specific sanitization and testing tools, and develop new verification methods to handle a broader spectrum of vulnerability classes.

Summary updated

BibTeX
@inproceedings{lee2025sec,
  author = {Hwiwon Lee and Ziqi Zhang and Hanxiao Lu and Lingming Zhang},
  title = {{SEC-bench: Automated Benchmarking of LLM Agents on Real-World Software Security Tasks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=QQhQIqons0},
}
Figure