一句话:提出三智能体 LLM 系统 AutoReview,实现漏洞检测、定位与修复的安全代码审查。
软件漏洞可能造成数据泄露、经济损失与服务中断,因此面向安全问题的代码审查至关重要。传统方法难以分析复杂代码并给出解释,而现有大语言模型虽在代码审查中展现潜力,却未聚焦安全问题。本文提出 AutoReview——一个基于 LLM 的多智能体安全代码审查系统,包含三个智能体:Issue Detector 利用知识级检索增强生成识别潜在漏洞;Issue Locator 通过基于图的代码切片精确定位漏洞位置;Issue Repairer 借助迭代验证生成上下文感知的修复方案。作者在 ReposVul 数据集上使用三个代码 LLM 进行评估,结果显示 AutoReview 在安全代码审查中效果显著:检测 F1 值提升 18.72%,定位精确率提升 27.75%,修复 BLEU 提升 14.82%。
Software vulnerabilities can lead to severe security issues such as data breaches, financial losses, and service disruptions, making security issue-oriented code review a crucial part of the development process. Traditional approaches struggle with analyzing complex code and providing explanations, while large language models (LLMs) show promise in code review but do not focus on security-related issues. To address these limitations, we propose AutoReview, an LLM-based multi-agent system for security code review. It integrates three agents: (1) Issue Detector identifying potential vulnerabilities using knowledge-level retrieval-augmented generation, (2) Issue Locator pinpoints the vulnerability positions through graph-based code slicing, and (3) Issue Repairer generating context-aware fixes via iterative verification. Evaluated on ReposVul with three code LLMs, AutoReview greatly demonstrates its effectiveness in security code reviews, improving F1-score for detection by 18.72%, precision for location by 27.75%, and BLEU for repair by 14.82% over baselines.