arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.33519cs.CRcs.AI
收藏

PRECEPT:基于演化原则的编码智能体安全自我提升

PRECEPT: Security Self-Improvement of Coding Agents via Evolving Principles

University at Buffalo(布法罗大学)

Keyan Guo, Rupam Patir, Haipeng Cai, Hongxin Hu

AI总结:

PRECEPT是为编码智能体配备安全自我提升能力的方法,通过演化库优化安全原则,在未见过的任务上使智能体安全可用代码占比达97.1%,优于无辅助及基线智能体。

摘要:

AI编码智能体越来越多地在人工审查有限的情况下编写并提交代码,其中许多代码通过了功能测试但仍存在安全漏洞。我们表明这类缺陷持续存在:在14个任务序列中,当看到失败的安全测试时,Codex、Claude Code和Qwen Code修复漏洞的概率为85.7%,但在新会话中重新引入同一漏洞类别的概率为26.7%,与从未见过该漏洞的智能体(27.5%)的概率相近。智能体具备修复漏洞的能力,但无法将该能力留存。无论是在智能体的持久上下文记录修复内容,还是提供已发布的安全编码原则,均未缩小这一差距:记录的修复仅与它所来源的任务类型相关,而为人类开发者编写的原则过于通用,无法应用于当前代码。相关知识存在,但未被激活。我们将这种缺失的能力称为安全自我提升:智能体从自身的安全失败中学习,使每一次经验能跨会话留存、适用于新代码,且不会破坏正常功能。我们提出PRECEPT,它通过一个演化库为编码智能体配备该能力,该库从权威安全编码原则起步,根据智能体自身的失败对原则进行修订,使每条原则能针对该智能体实际出错的代码发挥作用。仅当新的执行结果显示修订后的原则能提升代码安全性,同时保持功能成功率与未使用该库的智能体的功能成功率相差在较小容差范围内时,该修订才会被保留。改进会在演化步骤中持续推进,而非在第一步后就达到饱和。在演化过程中从未见过的任务类型上,PRECEPT最弱的智能体生成的安全可用代码占比达97.1%,高于最强的无辅助智能体(81.9%)和最强的基线智能体(87.7%)。

英文摘要:

AI coding agents increasingly write and submit code with limited human review, and much of it passes functional tests while remaining insecure. We show that these failures persist. Across 14 task sequences, Codex, Claude Code, and Qwen Code fixed a vulnerability 85.7% of the time when shown the failing security test, then reintroduced the same vulnerability class in a new session 26.7% of the time, about as often as agents that had never seen it (27.5%). The capability is present; the retention is not. Neither recording the repair in the agent's persistent context nor supplying published secure coding principles closed the gap: the recorded fix stayed tied to the family of the task it came from, and the principles, written for human developers, remained too general to apply to the code at hand. The knowledge exists; it is not activated. We call the missing ability security self-improvement: an agent learns from its own security failures so that each lesson persists across sessions, applies to new code, and does not break what works. We present PRECEPT, which equips coding agents with this ability through an evolving library that starts from authoritative secure coding principles and revises them against the agent's own failures, so that each principle comes to fire on the code where that agent actually goes wrong. A revision is kept only if fresh executions show it makes code more secure while keeping functional success within a small tolerance of the agent without the library. Improvement continues across evolution steps rather than saturating after the first. On task families never seen during evolution, PRECEPT's weakest agent reaches 97.1% secure working code, above the strongest unaided agent at 81.9% and the strongest baseline at 87.7%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑