Agent Recovery Gone Wrong: Measuring Harm Beyond Duplicate Calls
Abstract
Code-executing LLM agents submit blocks of code that issue several API writes. If a block fails after some of its writes have taken effect, the agent rewrites the block and continues. It is unknown how often such a recovery harms the external state when the failure occurs naturally in the code written by the agent. In this paper, we measure it on recorded trajectories of AppWorld agents. In a stratified random sample of 200 candidate episodes across ten models, 145 are partial executions confirmed by the database state. In the sample, 30 of 143 confirmed partial executions with a determinable outcome are followed by a harmful recovery, and its violation remains at the end of the run, which gives a stratification-weighted estimate of 24.6%. Two thirds of the harmful recoveries duplicate an effect, and the rest delete user data or make a wrong first-time write, e.g., an order of a wrong product. A rule that searches for repeated calls finds 75% of duplications but only 41% of all harm. We also examine two sources of operation identity for an idempotency contract. In a small pilot (17 episodes, one local model), identifiers supplied by the model do not detectably reduce harm, because the model issues a new identifier for the same operation. Identity derived from the call content, evaluated counterfactually on the sample, would have matched every harmful write in 14 to 18 of the 30 harmful recoveries, but in none of those with a wrong first-time write, and it would also have matched writes required by the task in 30 episodes. Based on these results, we outline design requirements for safer agent recovery.
Create a lesson
Metadata
- Categories
- cs.AI, cs.DB, cs.SE
- Comments
- 5 pages, 1 figure, 4 tables. Data, labels, and scripts: https://github.com/flame-stream/agent-recovery-harm
Related papers
ComputeWise: Measuring and Fixing GPU Waste by AI Research Agents
Shared title terminologycs.AIEgor Pakhomov, Nina Pakhomova, Anurag Koul et al.
Beyond the Black Box: A Diagnosis-Driven Agent for Interpretable MIP Solver Tuning
Shared title terminologycs.AIYidong Luo, Weihuang Wen, Xuanhao Pan et al.
Modeling Event-Conditioned Emotional Expression Response with LLM Agents in a Synthetic Social Simulation
Shared title terminologycs.AIRebecca Marigliano, Peter Carragher, Kathleen M. Carley
A Generative AI Agent to Emulate Interactive Human-driven Vehicles for Automated Driving Testing in Urban Areas
Shared title terminologycs.AIJia Hu, Changjian Yu, Panqu Wang et al.
AGL-SKILL: Coding Harnesses as Agentic Optimizers
Shared title terminologycs.AIRyan Tsui, Yuge Zhang, Yuqing Yang
TACT-Bench: Testing Adaptive Conversational Threats against Tool-Use Agents
Shared title terminologycs.AIIlia Hashemi Rad, Feijie Wu, Haoyu Wang et al.