Research map / Large language models / Agents, code and math
RepoAudit: An Autonomous LLM-Agent for Repository-Level Code Auditing
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes RepoAudit, an LLM agent that performs autonomous, demand-driven, path-sensitive repository-level bug detection (NPD, MLK, UAF) with a validator module to curb hallucinations.
Problem
Repository-level code auditing with LLMs is hindered by limited context windows, hallucinations that compound across prompts, and high time and token costs when analyzing large codebases for path-sensitive bugs.
Approach
An agent explores the repository function by function, using LLM-driven program abstraction, pointer handling, and feasible path exploration within each function, stores data-flow facts in agent memory, and validates outputs with a control-flow order check and an LLM-based path-condition satisfiability check before reporting bugs.
Key results
- RepoAudit with Claude 3.5 Sonnet detects 40 true bugs across 15 projects with 78.43% precision, averaging 0.44 hours and $2.54 per project.
- Compared with Meta Infer (7 TPs, 2 FPs on eight analyzed projects) and Amazon CodeGuru (0 TPs, 18 FPs), RepoAudit finds substantially more true bugs.
- RepoAudit reports 185 new bugs in ten actively maintained repositories, with 174 confirmed or fixed; precision is 88.46% with DeepSeek R1 and 86.79% with Claude 3.7 Sonnet, and 82.35% with o3-mini.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| remove program abstraction (RepoAudit-NoAbs) (ablation) | RepoAudit with Claude 3.5 Sonnet · NPD/MLK/UAF 15 projects | true positives and false positives: TPs 13+8 vs 21+19 ... precision drops to 40.38%; FPs rise to 31 (vs full) | Hurt |
| remove validators (RepoAudit-NoVal) (ablation) | RepoAudit with Claude 3.5 Sonnet · NPD/MLK/UAF 15 projects | false positives: FPs increase to 38 (from 31 for NoAbs; full method precision 78.43%) | Hurt |
| disable caching (RepoAudit-NoCache) (ablation) | RepoAudit with Claude 3.5 Sonnet · NPD/MLK/UAF 15 projects | prompts and time cost: prompts 3.55x, time 3.75x, cost 3.48x; icu exceeds 72 hours | Hurt |
| LLMDFA-PathScan vs RepoAudit (prompt rounds) | NPD and UAF comparison · NPD/UAF benchmarks | prompting rounds: 165x more prompts for LLMDFA-PathScan; 1737x for LLMDFA-SrcScan | Hurt |
| switch backbone from Claude 3.5 Sonnet to reasoning models (DeepSeek R1, Claude 3.7 Sonnet, o3-mini) | RepoAudit · 15 benchmark projects | precision: 88.46% / 86.79% / 82.35% vs 78.43% | Helped |
Surprising findings
- Directly prompting Claude 3.5 Sonnet with all relevant functions produced substantial hallucinations, reporting almost all dereferenced pointers as null even with few-shot examples.
- Meta Infer crashed on five of the thirteen projects that compiled successfully, even across multiple Infer versions.
Limitations
- Relies on LLM hallucination-prone reasoning; the validator only checks control-flow order and path-condition satisfiability, so FPs remain (precision 78.43%).
- Call-context exploration is bounded to four functions (K=4), which may miss deeper inter-procedural bugs.
- Evaluated on C projects and three bug types only; source matchers are hand-implemented per bug type.
Experimental setup
Datasets: 15 real-world C repositories from existing studies (sofa-pbrpc, ImageMagick, coturn, libfreenect, openldap, libsass, mem
Benchmarks: 15 real-world C projects with NPD, MLK, UAF bugs ten actively maintained repositories for new bug discovery
Metrics: precision true positives false positives # prompts input/output tokens financial cost time
Baselines: LLMDFA Meta Infer Amazon CodeGuru single-function LLM detector multiple-function LLM detector
Builds on: LLMDFA tree-sitter chain-of-thought prompting
Closest papers by meaning
- RepoLaunch: Automating Build and Management of Code Repositories across Languages and Platforms (NeurIPS 2026 · similarity 0.90)
- Build-and-Find: An Effort-Aware Protocol for Evaluating Agent-Managed Codebases (NeurIPS 2026 · similarity 0.88)
- SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents (NeurIPS 2024 · similarity 0.88)
- RepoMaster: Autonomous Exploration and Understanding of GitHub Repositories for Complex Task Solving (NeurIPS 2025 · similarity 0.88)
- RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph (ICLR 2025 · similarity 0.87)
- Improving Code Localization with Repository Memory (ICLR 2026 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
