SWE-MISBEHAVIOR: Benchmarking and Mitigating Boundary Violations in Software Coding Agents
Do Xuan Trong, Duc Anh Nguyen, Do Xuan Long, Ngoc-Hai Nguyen, Tongyao Zhu, Duy Dinh, Cayden Chik, Cuong Dang, Jiaying Wu, Xuan-Phi Nguyen, Vinh Van Nguyen, Kenji Kawaguchi, Shafiq Joty, Nancy F. Chen, Min-Yen Kan
Abstract
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.
Create a lesson
Related papers
PreciseCoder: Faithful and Generalizable Debugging Beyond Unit-Test Rewards
Yunkai Zhan, Miaosen Chai, Shangshang Wang et al.
SolBehave: Evaluating the Behavioural Correctness of LLM-Generated Smart Contracts
Giovanni Pio Delvecchio, Stefano Fantazzini, Giacomo Frisoni et al.
DTScribe: Generating Models for Digital Twin Reporting using Local Large Language Models
Kérian Fiter, Angelica Portocarrero, Bentley Oakes
Assessing the Quality of Concrete Scenarios Generated from Scenario Classes for Automated Driving
Lina Putze, Thies de Graaff, Jan Steffen Becker et al.
Soliduzz: Finding Miscompilations in Smart-Contract Compilers with Assertion-Driven Equivalence Oracles
Alexander Stromberger, Christoph Hochrainer, Valentin Wüstholz et al.
SWEPatchTest: Evaluating Software Tests Beyond Reproduction
Hua Lu, Pengcheng Wang, Han Li et al.