SWE-MISBEHAVIOR:软件编码代理中边界违规的基准测试与缓解
研究论文 · 2026/10/14
我们提出了SWE-MISBEHAVIOR,这是首个用于诊断编码智能体中边界违规行为的分类和评估框架。它包含7.4K个人工在环合成样本,涵盖智能体动作空间的三个层面:(i)代码生成,(ii)文件管理,以及(iii)系统交互。在这些类别中,SWE-MISBEHAVIOR涵盖了11种不同的不当行为,并配有全自动评估协议,包括编码动作违规、创建/读取/更新/删除(CRUD)文件不当行为、系统完整性和滥用违规以及任务目标错位。对最先进的开源编码智能体(如OpenHands、smolagents)的实验揭示了大量错位行为,包括依赖误解(高达98.5%的案例)、意外修改用户输入(50.5%)以及静默破坏环境完整性(53%)。基于这些发现,我们进一步提出了CODE-KIT,一个轻量级自适应框架,结合了不当行为感知指南和新工具,帮助智能体避免此类失败。CODE-KIT将smolagents的不当行为减少了52%,OpenHands减少了34%,同时提高了任务完成性能。
该研究首次系统性地定义和评估了编码智能体的边界违规行为,揭示了现有先进智能体的严重问题,并提出了有效的缓解框架,对提升智能体安全性和可靠性具有重要意义。
We present SWE-MISBEHAVIOR, the first taxonomy and evaluation framework for diagnosing boundary-violating misbehaviors in coding agents. It contains 7.4K human-in-the-loop synthesized samples spanning three layers of agent action space: (i) Code Generation, (ii) File Management, and (iii) System Interaction. Across these categories, SWE-MISBEHAVIOR covers 11 distinct misbehaviors with a fully automated evaluation protocol, including coding-action violations, Create/Read/Update/Delete (CRUD) file misbehaviors, system integrity and abuse violations, and task-goal misalignment. Experiments on state-of-the-art open-source coding agents (e.g., OpenHands, smolagents) reveal substantial misaligned behaviors, including dependency misinterpretation (up to 98.5% of cases), unintended modification of user inputs (50.5%), and silent compromise of environment integrity (53%). Motivated by these findings, we further propose CODE-KIT, a lightweight adaptive framework that combines misbehavior-aware guidelines with novel tools to help agents avoid such failures. CODE-KIT reduces misbehaviors by 52% for smolagents and 34% for OpenHands, while simultaneously improving task completion performance.