arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.24896cs.CRcs.CL
收藏

同伴压力:用于代码安全的攻击者与防御者群体的执行验证协同进化

Peer Pressure: Execution-Verified Co-Evolution of Attacker and Defender Populations for Code Security

AWS AI(亚马逊人工智能)

Khushbu Pahwa, Yubin Ge, Daniele Bonadiman, Xiaofei Ma, Yi Zhang

AI总结:

本研究提出基于执行验证的攻击者与防御者协同进化方法,采用PRPO算法训练LoRA适配器群体,在代码安全任务中显著提升了漏洞审查、恢复及越狱防御的性能。

摘要:

大语言模型(LLM)代码智能体交付的代码日益缺乏监督,而基于静态漏洞数据集训练的防御者难以适应攻击者的演化。本文提出协同训练攻击者与防御者,让执行过程决定所有奖励:攻击者(红队)编辑真实代码仓库,仅当补丁能应用、构建通过、通过测试、完成开发任务并在隔离容器中复现真实漏洞时才获得奖励,该容器还会标记漏洞入口点、关键操作及两者间的轨迹。同伴相对策略优化(PRPO)将双方建模为基于单个冻结基础模型的LoRA适配器群体,奖励计算时会将每个智能体与面临相同条件的同角色同伴对比,将群体置于策略梯度基线而非对手池中,并通过锦标赛保持多样性。匹配机制可抵消条件难度的影响:在相同覆盖率下,其平衡准确率比基于其他条件计算的基线高2.3个百分点,且验证器开销仅为策略内对照组的一半。PRPO的7B差异审查器在4个未见过的应用、3种未训练语言上达到64.8%的平衡准确率,比监督安全微调高5.5个百分点,比冻结前沿审查器(Claude Opus 4.8)高4.4个百分点,在其训练的应用上领先15.8个百分点。其9B仓库智能体在172个保留的VulnGym公告中恢复23个,而监督微调后仅恢复10个,相同骨干在相同框架下未训练时仅恢复7个;在43个可达入口点中定位17个,而使用GLM-5.2的mini-swe-agent定位13个。在越狱防御中保持算法不变时,相同算法在相同语料库和模型大小下达到或超过WildGuard的静态F1值;在独立于训练预言机的评估器下,其将攻击成功率从36.0%降至4.6%,而WildGuard为8.9%。

英文摘要:

LLM code agents increasingly ship code with little oversight, yet defenders trained on static vulnerability datasets fall behind adapting adversaries. We co-train attacker and defender instead, and let execution decide every reward: an attacker (Red) edits a real repository and earns nothing unless its patch applies, builds, passes the tests, completes its development task and reproduces a real exploit in an isolated container, whose path also labels the entry point, the critical operation and the trace between them. Peer-Relative Policy Optimization (PRPO) makes both sides populations of LoRA adapters over one frozen base and credits each against same-role peers that faced an identical condition, placing the population inside the policy-gradient baseline rather than the opponent pool, with a tournament preserving diversity. Matching cancels the condition's difficulty: at equal coverage it is worth 2.3 points of balanced accuracy over a baseline computed on other conditions, and it matches a within-policy control at half the verifier spend. PRPO's 7B diff reviewer reaches 64.8% balanced accuracy on four unseen applications in three untrained languages, 5.5 points above supervised security fine-tuning and 4.4 above a frozen frontier reviewer (Claude Opus 4.8), which it leads by 15.8 on the application it trains on. Its 9B repository agent recovers 23 of 172 held-out VulnGym advisories, against 10 after supervised fine-tuning and 7 for the same backbone untrained under the same scaffold, and locates 17 of 43 reachable entry points against 13 for mini-swe-agent with GLM-5.2. Run unchanged on jailbreak defense, the same algorithm matches or exceeds WildGuard's static F1 at equal corpus and model size. Under a judge distinct from its training oracle it cuts attack success from 36.0% to 4.6%, against WildGuard's 8.9%.

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

↑