arXiv:2607.29422cs.SEcs.AI2026-07

用多维度代码上下文提升AI修复漏洞的准确率

AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair

论文配图:AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair
图 1 · 摘自论文原文
  • 设计三类专用智能体构建代码结构、运行时和提交历史上下文
  • 在300个真实漏洞上达成73%修复成功率,比最强基线高29%
  • 适合安全工程与AI辅助开发方向的研究者参考

自动化漏洞修复旨在减少从漏洞报告中修复安全缺陷所需的时间和精力。近年来,基于智能体的AI方法在程序修复方面展现出良好前景。然而,漏洞修复需要比一般错误修复更丰富的程序上下文——这正是安全工程师在实践中常构建但现有智能体方法未充分工程化的部分。我们识别出三个关键差距:代码结构上下文(捕捉跨文件数据流与内存操作模式)、运行时执行上下文(揭示崩溃语义与内存来源)、提交历史上下文(还原脆弱代码模式的引入过程)。本文提出AgenticRepair框架,通过多维度程序上下文工程解决上述问题。该框架协调三个专用大模型子智能体分别生成上下文,并将其嵌入专用修复子智能体的记忆中,实现上下文驱动的补丁生成。在包含300个真实案例并使用沙箱验证的SEC-Bench上,AgenticRepair达到73%的成功率,显著优于最强基线29%。消融实验证明三类上下文相互互补,且多智能体架构与基础模型能力均起关键作用。这些发现确立了多维度程序上下文工程作为智能体漏洞修复的重要设计方向。

原文摘要 · Abstract (English)

Automated vulnerability repair aims to reduce the time and effort required to patch security flaws from a vulnerability triage report. Recent agentic AI approaches have shown promising results in automated program repair. However, vulnerability repair demands richer program context than general bug repair - context that security engineers routinely assemble in practice but that existing agentic approaches do not engineer. We identify three critical gaps: code-structure context capturing cross-file data flows and memory operation patterns, runtime-execution context revealing crash semantics and memory origins, and commit-history context recovering how fragile code patterns were introduced. We present AgenticRepair, an agentic vulnerability repair framework that addresses the gaps through multi-faceted program context engineering. AgenticRepair orchestrates three specialized LLM subagents to engineer the contexts, which are then embedded into the memory of a dedicated repair subagent for context-conditioned patch synthesis. Evaluated on SEC-Bench comprising 300 real-world instances with sanitizer-based patch verification, AgenticRepair achieves a 73% success rate, substantially outperforming the strongest baseline by 29%. Our ablation study confirms that the three context facets are mutually complementary, and that multi-agent scaffolding and base-model capacity each play an essential role. Collectively, these findings establish multi-faceted program context engineering as a promising design direction for agentic vulnerability repair.

漏洞修复智能体系统上下文工程AI安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。