Can You Undo It? Reversibility Classes for AI Agent Actions

Deepak Waghmare, Shaad SufiarXiv 2026 · arXiv

TL;DR

This paper introduces Reversibility Classes, a five-level framework (R0–R4) for classifying the "undo-ability" of AI agent actions. By shifting the focus from simple permission-based safety to a "recovery contract," the authors demonstrate a runtime guard that successfully blocks 100% of attributable attack actions in a benchmark replay while adding less than 0.5% to the user's approval burden.

What Problem Does This Paper Address?

As AI agents move from chat interfaces to "tool-using" entities that can edit files, query databases, and post to social media, we face a critical safety gap. Traditional security focuses on authorization: Is the agent allowed to call this tool?

However, authorization doesn't account for mistakes. If an agent deletes a critical database row or accidentally leaks a private API key, knowing the agent was "authorized" to use the database doesn't help you fix the mess. The authors argue that agent safety should instead focus on reversibility: If this action goes wrong, can we actually undo it?

Methods

The authors propose a formal vocabulary and a set of mechanisms to manage this risk:

  1. The R0–R4 Scale: A classification system ranging from R0 (No effect, like a read-only query) to R4 (Irreversible, like public disclosure or unrecoverable destruction).
  2. The Deployment Recovery Contract: A set of requirements for an action to be considered "Restorable" (R1). This includes capturing the prior state, having the authority to write it back, and ensuring no "outside observation" has occurred (which would turn a restorable edit into an irreversible disclosure).
  3. A Reference Classifier and Registry: The authors built a registry of 536 tools across 20 Model Context Protocol (MCP) servers, using argument-sensitive rules to determine the reversibility of a specific call (e.g., a SELECT statement might be R0, while a DROP TABLE is R3 or R4).
  4. Session Guard: A runtime gate that intercepts tool calls. By default, it allows R0–R1 actions to proceed but pauses for human approval on R2–R4 actions.
The R0-R4 classification scale and the gating logic used to decide when an agent needs human intervention.

Datasets

The study evaluates its framework using several sources:

  • The Reversibility Registry: A new dataset of 536 tools with 738 rule-case checks.
  • Agent Replay Dataset: 2,158 recorded runs (1,046 from AgentDojo and 1,112 from tau-squared-bench) using the Claude 3.7 Sonnet model.
  • Controlled Experiments: Custom-built testbeds for Git, SQLite, and three different web browsers (Chromium, Firefox, Safari) to test how state capture and "undo" commands behave in the real world.

Key Insights and Ideas

  • Arguments Matter: You cannot classify a tool by its name alone. git_commit might be restorable (R1) in a standard branch but irreversible (R4) if it triggers a production deployment pipeline.
  • The "Later Writer" Problem: A major finding was that even if you have a perfect backup, you might not be able to restore it. If a human colleague edits a file after the agent makes a mistake, restoring the agent's backup would erase the colleague's legitimate work.
  • Disclosure is a One-Way Street: The authors treat any "outside observation" as a move to R4. Once data is sent to an external API or a public channel, it can no longer be considered restorable, regardless of whether you can delete the local copy.
  • Native Hints are Insufficient: The authors found that existing tool annotations (like "read-only" flags in the Model Context Protocol) are too coarse. Their registry identified 118 differences where native hints failed to capture the nuances of reversibility.
Figure 2. Native hints lose distinctions expressed by the registry. (A) Base-label composition of 536 draft registry entries. (B) Annotation mapping for 481 comparable tools, with raw counts in each cell. The outlined R2 column is empty by construction. The 55 unmatched tools are excluded from the matrix. Disagreement with draft labels is not an accuracy estimate; full counts are in Table A3.

Key Results

  • Attack Prevention: In a replay of 29 attributable "attack-positive" runs, the Session Guard successfully gated (blocked for approval) 100% of the malicious actions. For comparison, a standard read/write proxy only caught 18 out of 29.
  • Low Friction: The system is surprisingly unobtrusive. Across 1,209 benign runs, the Session Guard only added 9 additional approval points compared to a basic read/write proxy—an increase in "approval burden" of just 0.47%.
  • Recovery Failures: Controlled studies exposed the limits of "undo." For example, a git soft reset failed to restore merge markers, and browser-based "undo" behavior varied wildly between Chromium and Safari, proving that recovery is highly dependent on the specific environment (the "deployment").
The tradeoff between gating attacks and bothering users with benign approval prompts.

Limitations and Future Work

The authors are careful to note that this is not a "solved" problem. Key limitations include:

  • Human Validity: The current registry relies on a single co-author's AI-assisted assessment. Future work requires multi-rater studies to ensure the vocabulary is interpreted consistently.
  • Concurrency: The experiments largely ignored "race conditions" where multiple agents or humans act simultaneously.
  • Semantic Scope: The classifier can't "see" inside arbitrary code or complex SQL scripts; it relies on the declarations in the registry being accurate.

The paper concludes that "there is an undo command" is never a sufficient justification for agent autonomy. Instead, developers must provide a "defensible restoration claim" that includes the prior state, the authority to restore it, and a boundary that excludes external effects.

Summary updated

Abstract

Tool-using AI agents change files, databases, access rights and public information, yet permission to call a tool does not establish whether a mistake can be undone. We present Reversibility Classes, a declared five-level vocabulary with argument-sensitive rules, conservative defaults and an explicit prior-state capture contract. The pinned implementation and evidence-linked registry cover 536 tools across 20 MCP servers. All 738 rule-case checks conform to declared expectations, while native annotation mapping differs from draft registry labels for 118 of 481 comparable tools. One AI-assisted reviewer approves 148 ratings, 75 matching the registry; this is not independent agreement. On 2,158 recorded runs, the implemented session guard gates the associated action in all 29 attributable attack-positive runs, compared with 18 for a read/write proxy, while adding nine approval points across 1,209 benign runs. Controlled file, Git, SQLite and three-browser experiments show that recovery depends on captured state, later changes, editor storage and recovery route, and expose a Git merge-state exception. The evidence supports making recovery assumptions explicit and testable. It does not establish registry-wide accuracy, reduced production harm or general recovery reliability.
BibTeX
@misc{waghmare2026can,
  author = {Deepak Waghmare and Shaad Sufi},
  title = {{Can You Undo It? Reversibility Classes for AI Agent Actions}},
  year = {2026},
  eprint = {2611.22075},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.22075},
}
Figure