Automated Failure Attribution in Long-Horizon Agent Runs
A research project that answers the question every failed agent run raises: which step broke it? Building an attributed corpus...
A research project that makes recovery a first-class evaluation object: injecting controlled, sandboxed unsafe-execution events into agent benchmarks and measuring how well agents recover — rollback, compensation, escalation, state restoration, damage containment — comparing explicit recovery policies against re-prompting on recovery success, time-to-recovery, and residual risk.

A research project about the moment after the mistake. Agent benchmarks overwhelmingly measure whether an agent avoids unsafe actions — and stop at the first failure. Production reality does not stop there: an agent that has already executed an unsafe tool action still faces the consequential questions. Does it notice? Does it contain the damage? Can it roll back state, compensate for the action’s effects, or escalate to a human — and at what cost, in what time, with how much residual risk? This project makes recovery a first-class evaluation object. It injects controlled, sandboxed unsafe-execution events into public benchmark environments, instruments the recovery trajectory that follows, and compares explicit recovery policies (rollback, compensation, escalation) against the implicit baseline of re-prompting — producing the first systematic measurement of how well agents recover, not merely whether they err.
>Sandbox-only research on synthetic failures. Every unsafe-execution event in this project is synthetic, injected by the researcher, inside isolated benchmark environments (RiOSWorld, TheAgentCompany) with reversible operations and synthetic state. No real systems, data, funds, or communications are ever involved. The project describes unsafe-execution scenarios only at the design/evaluation level; it develops no attack techniques and provides no procedures for causing real-world harm.
Benchmarks measure first failures; deployments live with their consequences. An agent that executes an unsafe tool action — sends information to the wrong recipient, modifies state it should not have touched, confirms the wrong transaction — has not finished failing: the run continues, and everything the agent does next either contains the damage or compounds it. The evaluation literature has essentially no measurement of this phase. Benchmarks terminate or score at the unsafe event; no published suite scores whether the agent noticed the error, restored prior state, limited the action’s spread, notified the user, or escalated appropriately. Meanwhile the closest prior mechanism — ToolSafe’s step-level feedback — treats correction as a guardrail feature within an execution loop, not as an evaluated capability with measurable quality dimensions. The research problem is precise: recovery from unsafe tool execution has no definition, no metrics, no benchmark injection methodology, and no comparative evidence on recovery policies, leaving practitioners to design recovery behavior by intuition.
Prevention will never be perfect, so the quality of the response after failure is a load-bearing property of any deployed agent. The difference between a good and bad recovery is not cosmetic: a fast rollback with correct user notification turns an incident into a log entry; silent continuation after a wrong transfer compounds it. Designers currently choose among rollback, compensation, and escalation with zero evidence about which works when — the exact state of prevention knowledge before the defense-evaluation literature matured. Measuring recovery also reframes safety economics: if explicit recovery policies recover most of the damage from a controlled unsafe action at bounded cost, then system-level safety is the product of prevention and recovery, and evaluations that measure only prevention systematically overstate the risk of systems with good recovery — or understate it for systems without. Either finding changes how agents should be built and scored.
The neighboring territory is mapped. RiOSWorld established a risk taxonomy for multimodal agent tasks — a graded classification of which actions are risky and why — providing the principled source of unsafe-action categories for injection design. TheAgentCompany demonstrated long-horizon benchmark execution in reproducible sandboxed environments with rich state, providing the host where recovery behavior can be observed. ToolSafe provided step-level guardrails and feedback loops — the closest mechanism to recovery — establishing that post-error intervention within an execution loop is implementable and measurable. τ-bench contributed the policy-adherence evaluation style that recovery-with-notification naturally extends.
What no published work does, per the planning evidence, is treat recovery itself as the evaluation object: no benchmark measures recovery success after unsafe tool execution, no metric suite exists for recovery quality (containment, time-to-recovery, residual risk, notification correctness), no controlled methodology exists for injecting unsafe-execution events that is both safe (sandboxed, reversible, synthetic) and scientifically valid (comparable across agents), and no comparative study contrasts explicit recovery policies — rollback, compensation, escalation — against the implicit default of continuing with re-prompting. The defensible gap statement: risky-action taxonomies and guardrail feedback exist, and long-horizon sandboxed hosts exist, but recovery dynamics after unsafe execution are unstudied as an evaluation dimension.
Four questions connect these findings to this project. First, detection: do agents reliably notice that an executed action was unsafe — or do they continue confidently, treating the error as ordinary task state? Second, policy comparison: which recovery policy family works when — does rollback dominate for reversible state changes, compensation for externally-visible actions, escalation for irreversible ones, and does any single policy dominate overall? Third, dynamics: what are the time and token costs of recovery, and how does residual risk (effects of the unsafe action that recovery fails to undo) distribute across policies and event types? Fourth, interaction: how does recovery behavior interact with task continuation — do agents that recover well also complete the original task, or is there a measurable recovery-versus-completion trade-off? None of these is answered by existing work, because no published evaluation measures the recovery phase at all.
> When agents execute unsafe tool actions in sandboxed benchmark environments, which recovery policies — rollback, compensation, or escalation — achieve the highest recovery success at bounded time and token cost, with the least residual risk, and how do explicit policies compare against the implicit re-prompting default?
We hypothesize that explicit recovery policies outperform implicit re-prompting on recovery success and residual risk, that the dominant policy is event-dependent — rollback for reversible state operations, compensation for externally-visible effects, escalation for irreversible ones — and that a policy-selection rule conditioned on event reversibility recovers more value than any single fixed policy. We further hypothesize that detection is the hidden bottleneck: a measurable share of recovery failures will originate not in poor recovery execution but in the agent never recognizing the unsafe event, which re-prompting cannot fix and explicit monitoring can.
The investigation proceeds in four movements. (1) Injection design. Define a controlled unsafe-event catalog drawn from RiOSWorld’s risk taxonomy and instantiated in TheAgentCompany’s sandbox: events span reversibility classes (fully reversible state edits, semi-reversible external messages to simulated recipients, irreversible-but-contained operations), each with a defined ground-truth recovery target — the state and notifications that constitute successful recovery. Injection is researcher-triggered, scripted, and logged; the catalog and triggers are design artifacts of the harness, described publicly at this level only. (2) Instrumentation. Extend the harness to observe the recovery trajectory: post-event state diffs, subsequent tool calls, user-notification events, token and wall-clock costs, and final task state — yielding per-run recovery records aligned to the ground-truth targets. (3) Policy implementation. Implement recovery policies as scaffold components: (a) implicit baseline — the agent continues with its normal loop (re-prompting only what the harness already does); (b) rollback policy — detect-then-restore from checkpointed state; (c) compensation policy — issue corrective actions (simulated recall messages, reversed operations where the catalog defines them); (d) escalation policy — halt and request simulated human confirmation, modeled with coverage and delay parameters from τ-bench-style user simulation; (e) selection policy — choose among the above via an event-reversibility rule. (4) Comparative evaluation. Run the policy × event-class matrix across two agent models with repeated trials, measuring the full metric suite and mapping which policy wins where, at what cost, and with what residual risk.
A bounded, executable 6–12 month version: implement the injection catalog for one host environment (TheAgentCompany, RiOSWorld-risk-taxonomy-instantiated), instrument recovery trajectories, and compare three policy families (implicit baseline, rollback, escalation) plus the selection rule across two event reversibility classes, delivering (a) the recovery-benchmark extension with its injection methodology, (b) the first comparative recovery-policy results, and (c) the metric suite and harness code released for reuse. This scope produces one focused contribution — recovery as a measured evaluation dimension — without requiring multi-host saturation or learned recovery policies.
The doctoral program generalizes along three genuine axes. Recovery-policy learning: replace hand-designed selection rules with learned policies trained on recovery outcomes, and study whether learned policies discover recovery strategies (partial compensation, deferred escalation) that hand-designed rules miss. Containment theory: formalize damage containment — what “residual risk” means operationally, how it bounds under policy classes, and whether recovery guarantees can be stated and checked for restricted action types. Cross-domain transfer: test whether recovery skills learned in one environment transfer to another (TheAgentCompany to RiOSWorld), measure how much injection-catalog diversity recovery evaluation needs, and connect the framework to incident-response practice from systems reliability engineering.
Environment/dataset: TheAgentCompany as host with the RiOSWorld-taxonomy-derived injection catalog; one open-weights agent model family primary, one second model for robustness; simulated-user channel parameterized from τ-bench style. Baseline: implicit continuation; ToolSafe-style feedback; escalation-always. Proposed method: rollback, compensation, and selection policies with detection components. Test conditions: full policy × event-class (reversible / semi-reversible / irreversible) matrix; with and without oracle detection. Control conditions: no-injection runs per policy (recovery machinery must not damage clean-task performance); sham-injection runs (harness trigger fires, no event) to verify measurement does not itself perturb behavior. Metrics: as listed above. Statistics: repeated trials per cell (n ≥ 5), bootstrap CIs on recovery success and residual risk; paired comparisons across policies on matched event sets; detection-latency distribution analysis. Ablations: detection component removed (oracle-only); notification step removed; checkpoint frequency varied for rollback; selection rule ablated to each fixed policy. Generalization tests: the frozen catalog-instantiation methodology applied to a RiOSWorld task subset as a second host; optionally one additional reversibility class (partially-compensable events) if time allows.
A potential contribution takes the form of: (a) the recovery-benchmark extension — the first sandboxed unsafe-execution injection methodology with ground-truth recovery targets, (b) the first comparative study of recovery policies for tool-using agents, and (c) a metric suite and released harness that future benchmarks can adopt for recovery scoring. The project does not promise that any policy recovers well — a finding that current agents rarely even detect unsafe events would be a significant negative result that redirects attention to detection, and the design will measure it rather than assume it away.
Recovery targets are ground-truth by catalog definition; real incidents involve stakeholder disagreement about what “recovered” means, which the benchmark’s clean definitions do not capture. The event catalog, though taxonomy-derived, is finite — recovery behaviors outside its classes are unmeasured. Escalation is modeled with simulated users (parametric coverage and delay), so findings about human-in-the-loop recovery inherit simulation’s simplifications. The host environments are computer-use and occupational-task sandboxes; recovery in API-only or physical-action settings may behave differently. Detection-quality findings are specific to the studied models and scaffold styles. Finally, injected events are researcher-scripted; naturally-occurring unsafe actions may present different signals than designed ones, and the catalog approach cannot fully anticipate that gap.
All unsafe-execution events are synthetic, researcher-injected, and confined to isolated sandbox environments with reversible operations and synthetic state — no real systems, user data, funds, communications, or third-party services are ever involved. The injection methodology is a measurement instrument, not an attack technique: it triggers defined failure conditions the research harness itself defines, and public documentation describes it at design/evaluation level only — no exploit code, no payloads, no procedures for compromising real systems. Escalation channels are simulated; no human subjects receive real notifications. The project’s purpose is defensive: giving the field its first measurements of recovery quality so deployed agents can fail more safely. Findings about detection weaknesses are reported as evaluation results with benchmark context, not as evasion guidance.
A research project that answers the question every failed agent run raises: which step broke it? Building an attributed corpus...
A research project that audits the measurement instruments themselves: applying the ABC validity-checklist methodology to agent-security benchmarks to find task-validity...
A research project that audits the auditors: measuring how position, verbosity, and self-preference biases distort LLM-judge judgments of safety violations...
Ready to level up? These ideas offer more complexity:
Published on September 13, 2026
A team of developers, researchers, and innovators who review and publish practical ideas for builders and creators.
Published on September 13, 2026
A team of developers, researchers, and innovators who review and publish practical ideas for builders and creators.