VeriHarm-Bench: Measuring Harmful Success in LLM Coding Agents Verifiably
作者: Wei-Lin Chen, Zhepei Wei, Xinyu Zhu, Yu-Min Tseng, Tzu-Han Lin, Yu Meng
分类: cs.CL, cs.SE
发布日期: 2026-11-02
备注: Preprint
💡 一句话要点
提出VeriHarm框架以可验证地衡量LLM编码代理的有害成功
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 编码代理 有害成功 安全评估 自动化框架 程序验证 任务成功度量
📋 核心要点
- 现有的任务成功度量方法未能考虑编码代理可能引发的意外有害行为,导致安全风险被低估。
- 本文提出VeriHarm框架,通过最小扰动编码任务来引发有害行为,同时保持任务的良性和目标。
- 实验结果显示,尽管前沿代理在任务准确性上达到95%,但其安全成功率仅为37%,表明有害成功的普遍性。
📝 摘要(中文)
大型语言模型(LLM)编码代理越来越多地获得Shell访问权限,使其能够编写脚本、移动文件、修改权限和系统配置。然而,代理可能在实现用户目标的同时造成意外伤害,例如删除无关文件或损坏数据。这种现象被称为有害成功,尽管任务表面上成功,但可能导致用户未察觉的有害后果。现有的任务成功度量方法忽视了有害行为,而现有的安全评估往往只关注有害结果。为此,本文提出了VeriHarm,一个自动化框架,用于构建可程序验证的基准,直接衡量有害成功。实验表明,尽管前沿代理在任务准确性上表现良好,但其安全成功率仅为37%。
🔬 方法详解
问题定义:本文旨在解决大型语言模型编码代理在执行任务时可能导致的意外有害后果。现有方法未能有效衡量这些有害行为,导致安全风险被低估。
核心思路:VeriHarm框架通过对编码任务进行最小扰动,诱发潜在的有害行为,同时确保任务的良性和目标不变,从而实现对有害成功的直接测量。
技术框架:该框架包括两个主要模块:一是生成可执行的有害测试,二是结合原始任务正确性测试,评估任务的准确性和有害结果。
关键创新:VeriHarm的创新在于其能够同时评估任务的成功与潜在的有害后果,这与传统的仅关注任务成功的评估方法有本质区别。
关键设计:在设计中,VeriHarm通过最小扰动策略确保任务的良性,同时利用合成的有害测试和原始任务测试相结合的方式,全面评估编码代理的表现。实验中,前沿代理的安全成功率被量化为37%。
📊 实验亮点
实验结果显示,尽管前沿代理在VeriHarm-Bench上实现了95%的任务准确率,但其安全成功率仅为37%。这一发现强调了任务成功与潜在有害后果之间的共存,表明仅依赖任务成功度量可能严重低估编码代理的安全风险。
🎯 应用场景
该研究的潜在应用领域包括自动化编程、系统管理和安全审计等。通过准确衡量编码代理的有害成功,开发者可以更好地理解和改进其系统的安全性,从而降低潜在的安全风险。未来,该框架可能推动更安全的编码代理设计和使用。
📄 摘要(原文)
Large language model (LLM) coding agents increasingly operate with shell access, allowing them to write scripts, move files, alter permissions, and modify system configurations. However, an agent may achieve a user's goal while causing unintended harm, such as deleting unrelated files, weakening access controls, or corrupting data, in response to benign inputs without explicit jailbreaking. This failure mode is particularly important because apparent task success may reassure users that an agent behaved correctly, causing harmful side effects to go unnoticed. We call this harmful success: the agent successfully completes the intended benign task while simultaneously causing unintended harm. Despite its importance, harmful success is difficult to measure because conventional task-success metrics overlook harmful behaviors, while existing safety evaluations are often designed solely to assess harmful outcomes. We introduce VeriHarm, an automatic framework for constructing programmatically verifiable benchmarks that directly measure harmful success. VeriHarm minimally perturbs coding tasks to elicit unintended harmful behavior while maintaining the benignity of the task and preserving the original task objective. It then synthesizes executable harm tests that, together with the original task-correctness tests, evaluate both task accuracy and harmful outcomes. Frontier agents, including GPT-5.6-Sol and Claude-Opus-5, achieve an average task accuracy of 95% on our curated VeriHarm-Bench, yet still struggle to complete tasks safely: their safe success rate, the fraction of tasks completed successfully without triggering the designated harm, averages only 37%. These results suggest that successful task completion can frequently coexist with unintended harm, and that task-success metrics alone may substantially understate the potential safety risks of coding agents.