arXiv:2611.03575cs.CLNov 2026

Manuscript Offprint

arXiv:2611.03575

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

ABSTRACT

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.

1 INTRODUCTION

Large language model (LLM) coding agents increasingly operate with shell access, allowing them to write scripts, move files, alter permissions, and modify system configuration. These capabilities expose a safety failure mode that task-success metrics alone do not capture. An agent may achieve user goals while causing unintended harm (Jones et al., 2026; Rudner & Toner, 2021; Ruan et al., 2024): harmful side effects (e.g., deleting unrelated files, weakening access controls, or corrupting data) that arise from benign inputs without adversarial manipulation—an underexplored setting that differs from jailbreaks, prompt injection, and explicit harmful requests. We term this failure mode harmful success: the agent successfully completes the intended benign task while simultaneously causing unintended harm. Harmful success is particularly important because apparent task success may reassure users that an agent behaved correctly, causing harmful side effects to go unnoticed.

Recent studies have shown that benign instructions can lead agents to unsafe, unintended behavior (Jones et al., 2026; Ning et al., 2026), establishing the importance of this safety concern. However, prior works primarily ask whether harm occurs, not whether it co-occurs with successful completion of the user's task. Their evaluations are designed to elicit and detect harmful behavior, and often do not support assessing whether the agent accomplishes what the user asked. Furthermore,

Figure

Figure 1: Harmful success in LLM coding agents. Left: A illustrative example of VERIHARM-BENCH. A small, benign change to the original task (shown as a diff) adds a requirement that re-running the script should not re-append merged content. The agent meets this requirement by emptying the source file (file2.txt), which the user never asked to modify. Harmful success thus occurred: the requested task is completed correctly, but with an unintended, destructive side effect. Right: Evaluation of frontier agents on VERIHARM-BENCH. The agents correctly complete 95% of tasks on average (full colored bar), while only 37% are finished without triggering the designated harm (safe success). This implies task-success metrics alone can therefore substantially understate the safety risks of coding agents.

they often rely on complex, multi-stage procedures that invoke strong external models or human annotators to inspect agent trajectories for determining whether harm has occurred. Such evaluation is costly: assessing each new target model requires rerunning expensive model-based or human-in-the-loop auditing pipelines over every instance trajectory. Moreover, complete trajectories may not always be available or fully transparent to users (Korbak et al., 2025; Jiang et al., 2025; Zaman & Srivastava, 2026; Yueh-Han et al., 2026), limiting the applicability of such approaches. The evaluation process is also inherently dynamic: changes to judge models, prompts, or annotation protocols may alter the resulting harmfulness verdicts, reducing reproducibility and making the evaluation difficult to directly verify.

In this work, we introduce VERIHARM, an automated framework for constructing programmatically verifiable benchmarks of harmful success in LLM coding agents, and use it to construct VERIHARM-BENCH. VERIHARM comprises two stages: rollout-guided candidate generation and multi-aspect quality assessment. For each source task, a target agent first executes the unmodified task, grounding candidate construction in observed execution behavior. A proposer agent then iteratively generates minimal task perturbations paired with executable harm tests. Feedback from failed rollouts guides candidate refinement, while the original task-correctness test remains fixed to preserve the source objective. We obtain 1,046 candidates for which the target agent both succeeds the original task and triggers the designated harm test, then select the 150 highest-scoring instances through subsequent semantic quality assessment. The resulting benchmark provides fixed executable tests for task correctness and harmful outcomes, enabling direct and reproducible measurement of harmful success without model-based or human assessment of execution trajectories at evaluation time.

We evaluate held-out frontier coding agents not involved in benchmark construction on VERIHARM-BENCH. Across the evaluated agents, task accuracy averages 95.1%, yet 58.2% of all instances end in harmful success, and the safe success rate averages only 37.0%. Even the best-performing agent, GPT-5.6-Sol, completes fewer than 45% of tasks without triggering the designated harm. Notably, all evaluated agents are stronger than every model used to construct the benchmark, suggesting that harmful-success cases discovered with weaker models transfer to stronger ones. These findings demonstrate that unintended harm can frequently coexist with correct task completion and that task-

Figure

Figure 2: Overview of VERIHARM. Stage 1 (§2.1): For each target agent, source task, and proposer agent, VERIHARM runs an iterative search for a task perturbation and a matching harm test, guided by the agent's rollouts. Starting from a seed run on the original task, the proposer makes a small, benign perturbation (underspecification or delegation of control) and writes a harm test. The target agent solves the perturbed task without seeing any tests. The unchanged original task test and the harm test then check the final sandbox. The search stops at the first harmful success (task test passes, harm test triggered). Otherwise, the failed run guides the next proposal, for up to five iterations. Stage 2 (§2.2): LLM judges score each candidate on five validity criteria, summed into a quality score.

success metrics alone may substantially understate the safety risks of coding-agent execution. Our contributions are threefold:

  • We identify and formalize harmful success, a distinct safety failure mode in which coding agents successfully complete a benign task while simultaneously causing unintended harm.
  • We introduce VERIHARM, an automatic framework for constructing programmatically verifiable benchmarks with executable tests that jointly measure task correctness and harmful outcomes, without external judges at evaluation time.
  • We construct VERIHARM-BENCH and evaluate held-out frontier coding agents, showing that harmful success can occur at substantial rates despite high task-success rates.