PRECEPT:通过演化原则实现编码智能体的安全自我改进
PRECEPT: Security Self-Improvement of Coding Agents via Evolving Principles
AI 导读
PRECEPT 是一个让编码智能体从自身安全失败中持续改进的方法,通过基于权威安全编码原则并根据智能体实际失败不断修订的演化原则库实现跨会话的安全能力保留。实验显示,Codex、Claude Code 和 Qwen Code 在 14 个任务序列中修复漏洞后,仍会在新会话中以 26.7% 的概率重新引入同类漏洞。
正文 · 原文
Abstract: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%.
| Comments: | 19 pages, 3 figures, 14 tables |
| Subjects: | Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2611.33519 [cs.CR] |
| (or arXiv:2611.33519v1 [cs.CR] for this version) | |
| https://doi.org/10.48550/arXiv.2611.33519 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Keyan Guo [view email]
[v1]
Tue, 24 Nov 2026 22:52:27 UTC (511 KB)
来源:arXiv cs.AI · arxiv.org