arXiv:2509.16275cs.CRcs.AI2025-09ICML被引 3

用本地小模型+静态分析,自动修复Python漏洞且减少误报。

SecureFixAgent: A Hybrid LLM Agent for Automated Python Static Vulnerability Repair

  • 结合Bandit检测与轻量LLM生成修复建议,迭代验证。
  • 误报率降10.8%,修复准确率提升13.51%,三轮内收敛。
  • 解释清晰可读,适合需可信自动化修复的开发者。

现代软件开发面临大规模代码库及复杂依赖的安全挑战。静态分析工具如Bandit能有效检测漏洞,但误报率高且无修复能力;大语言模型(LLMs)虽可提供建议,却常产生幻觉且缺乏自验证。本文提出SecureFixAgent,一种融合Bandit与轻量级本地LLM(<8B参数)的混合修复框架,采用迭代检测-修复-验证循环。为提升精度,基于多领域精选数据集,采用参数高效微调(LoRA)方法缓解数据偏差并减少冗余修改。该系统由Bandit负责检测,LLM生成带解释的修复方案,再通过Bandit重新验证,全程本地运行以保障隐私并降低对云服务依赖。实验表明,SecureFixAgent相比静态分析误报率降低10.8%,修复准确率提升13.51%,相比预训练LLM误报率下降5.46%,通常在三轮内完成修复。开发者调研显示解释质量达4.5/5,凸显其对人类信任与采纳的价值。通过在资源高效本地环境中实现可验证的安全改进与透明推理,SecureFixAgent推动了现代开发流水线中可信自动化漏洞修复的发展。

原文摘要 · Abstract (English)

Modern software development pipelines face growing challenges in securing large codebases with extensive dependencies. Static analysis tools like Bandit are effective at vulnerability detection but suffer from high false positives and lack repair capabilities. Large Language Models (LLMs), in contrast, can suggest fixes but often hallucinate changes and lack self-validation. We present SecureFixAgent, a hybrid repair framework integrating Bandit with lightweight local LLMs (<8B parameters) in an iterative detect-repair-validate loop. To improve precision, we apply parameter-efficient LoRA-based fine-tuning on a diverse, curated dataset spanning multiple Python project domains, mitigating dataset bias and reducing unnecessary edits. SecureFixAgent uses Bandit for detection, the LLM for candidate fixes with explanations, and Bandit re-validation for verification, all executed locally to preserve privacy and reduce cloud reliance. Experiments show SecureFixAgent reduces false positives by 10.8% over static analysis, improves fix accuracy by 13.51%, and lowers false positives by 5.46% compared to pre-trained LLMs, typically converging within three iterations. Beyond metrics, developer studies rate explanation quality 4.5/5, highlighting its value for human trust and adoption. By combining verifiable security improvements with transparent rationale in a resource-efficient local framework, SecureFixAgent advances trustworthy, automated vulnerability remediation for modern pipelines.

漏洞修复LLM应用静态分析自动化安全

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