让AI修复代码前先验证漏洞可被利用,提升跨语言安全分析可靠性。
Verify Before You Fix: Agentic Execution Grounding for Trustworthy Cross-Language Code Analysis
- 通过执行验证闭环,确保修复前确认漏洞可被利用。
- 跨语言漏洞检测零样本F1达74.43%-80.12%,92%以上修复成功。
- 支持Java/Python/C++三语言,且修复过程可解释。
部署在智能体流程中的学习型分类器存在根本可靠性问题:预测是概率推断而非验证结论,若未基于可观测证据行动,将导致下游阶段错误累积。软件漏洞分析使这一代价具体可测。本文提出统一的跨语言漏洞生命周期框架,包含三个由大模型驱动的推理阶段:混合结构-语义检测、执行基础的智能体验证、验证感知的迭代修复,严格遵循不变式:无执行验证确认可利用性,绝不执行修复。跨语言泛化通过通用抽象语法树(uAST)实现,将Java、Python和C++统一为共享结构模式,并结合GraphSAGE与Qwen2.5-Coder-1.5B嵌入,通过学习型双向门控融合,每样本权重提供内在可解释性。框架在单语言检测中准确率达89.84%-92.02%,零样本跨语言F1达74.43%-80.12%,端到端解决69.74%漏洞,总失败率仅12.27%。消融实验表明:移除uAST使跨语言F1下降23.42%,关闭验证使无效修复增加131.7%。结果证明,执行基础的闭环推理是可信的、可落地的大型语言模型智能体机制。
原文摘要 · Abstract (English)
Learned classifiers deployed in agentic pipelines face a fundamental reliability problem: predictions are probabilistic inferences, not verified conclusions, and acting on them without grounding in observable evidence leads to compounding failures across downstream stages. Software vulnerability analysis makes this cost concrete and measurable. We address this through a unified cross-language vulnerability lifecycle framework built around three LLM-driven reasoning stages-hybrid structural-semantic detection, execution-grounded agentic validation, and validation-aware iterative repair-governed by a strict invariant: no repair action is taken without execution-based confirmation of exploitability. Cross-language generalization is achieved via a Universal Abstract Syntax Tree (uAST) normalizing Java, Python, and C++ into a shared structural schema, combined with a hybrid fusion of GraphSAGE and Qwen2.5-Coder-1.5B embeddings through learned two-way gating, whose per-sample weights provide intrinsic explainability at no additional cost. The framework achieves 89.84-92.02% intra-language detection accuracy and 74.43-80.12% zero-shot cross-language F1, resolving 69.74% of vulnerabilities end-to-end at a 12.27% total failure rate. Ablations establish necessity: removing uAST degrades cross-language F1 by 23.42%, while disabling validation increases unnecessary repairs by 131.7%. These results demonstrate that execution-grounded closed-loop reasoning is a principled and practically deployable mechanism for trustworthy LLM-driven agentic AI.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。