Grafy News
Try Grafy free

New Reversibility Classes Define How AI Agents Can Undo Their Actions

Researchers introduce a five‑level Reversibility Class system to declare whether tool‑using AI agents can safely undo changes.

Illustration for the news story: New Reversibility Classes Define How AI Agents Can Undo Their ActionsSource: Grafy Research Lab

What are Reversibility Classes?

Tool‑using AI agents can modify files, databases, access rights and public information, but merely granting permission to call a tool does not guarantee that a mistake can be undone. To make the undoability of an action explicit, Deepak Waghmare and Shaad Sufi propose Reversibility Classes, a five‑level vocabulary that declares the recovery contract for each tool call. According to the authors, the classes are meant to sit alongside existing capability restrictions, severity assessments and model‑confidence checks, providing a separate question: given the effects of a successful call and the recovery mechanisms available to the acting principal, what can be restored or compensated? (arXiv:2611.22075).

How are the five classes defined?

The taxonomy ranges from R0 (fully reversible) to R4 (irreversible). The key criteria are:

  • Exact restoration requires a complete prior‑state capture, the principal’s ability to write that state back, and no external parties having observed the change.
  • R1 demands full restoration of the prior state.
  • R2 permits a bounded difference that the principal accepts as compensation.
  • R3 allows partial compensation where some side‑effects remain.
  • R4 denotes actions that cannot be undone, typically because the change has been disclosed to outsiders.

The classifier maps a proposed tool call to one of these classes based on argument‑sensitive rules stored in a registry. Unrecognized calls default to R4. The system also supports deployment‑specific overrides, but a disclosure cannot be lowered while it remains in scope.

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 to…
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. Figure 2 of “Can You Undo It? Reversibility Classes for AI Agent Actions” by Deepak Waghmare, Shaad Sufi (arXiv.org), CC BY 4.0.

How was the system evaluated?

The authors built a registry covering 536 tools across 20 Multi‑Capability Platform (MCP) servers. Each entry records the tool’s declared class, rationale, and optional fields such as compensation cost or undo window. The evaluation involved:

  1. Rule‑case checks – 738 individual checks were run, and every one conformed to the declared expectations.
  2. Comparison with native MCP annotations – For 481 comparable tools, the registry’s labels differed from the MCP’s native hints in 118 cases, highlighting the added granularity of the Reversibility Classes (see Figure 2).
  3. AI‑assisted human review – One reviewer approved 148 ratings, with 75 matching the registry; the authors note this does not constitute independent agreement.
  4. Recorded policy replay – Using 2,158 recorded agent runs, the implemented session guard blocked all 29 attributable attack‑positive runs, outperforming a read/write proxy that blocked only 18.
  5. Controlled recovery experiments – Tests on file systems, Git repositories, SQLite databases and three browsers examined how captured state, later changes, editor storage and recovery routes affect undoability (see Figure 1 for the overall mechanism).

The full implementation, classifier code and specification are released under CC BY 4.0 at the TwoMuch Labs GitHub repository.

What did the experiments reveal about undoability?

The empirical results paint a nuanced picture:

  • Session‑aware enforcement proved effective: the guard prevented every recorded attack‑positive run, adding nine approval points across 1,209 benign runs.
  • Recovery depends on captured state – In the Git and SQLite scenarios, exact restoration was only possible when a full snapshot existed before the change. Dropping a newly created SQLite table left an empty internal sequence table, illustrating the distinction between R1 (full restore) and R2 (bounded difference).
  • Later edits can invalidate undo – A file edited after an agent’s action may overwrite the saved prior version, making later‑writer guards essential.
  • Disclosure is often irreversible – Even if a public message can be deleted, the fact that it was seen by readers classifies the action as R4 under the current convention.
  • Tool‑specific quirks – The Git merge‑state exception uncovered a case where a merge could not be cleanly undone without manual intervention.

Overall, the study demonstrates that making recovery assumptions explicit is feasible, but it does not prove that the registry is universally accurate or that production‑level harm is eliminated.

How can developers incorporate reversibility into their AI agents?

Developers building tool‑using agents can start by declaring the expected reversibility of each tool call. The open‑source classifier can be integrated into an agent’s runtime pipeline to enforce the chosen policy. Practical steps include:

  1. Catalog your tools – Create a JSON record for each tool, specifying the class, argument‑sensitive rules and any required prior‑state capture (e.g., a file backup or database snapshot).
  2. Add a session guard – Use the reference implementation to intercept tool calls, query the classifier and either allow, request confirmation or block the call based on the configured policy.
  3. Test recovery paths – Replicate the controlled experiments (file edit, Git commit, SQLite operation) to verify that your backup or undo mechanisms satisfy the R1 requirements.
  4. Leverage Grafy – Use Grafy Code (/code) to prototype the classifier integration in a sandboxed environment, and Grafy Reader (/reader) to explore the full paper and its supplemental data without leaving the workspace. For visualizing the decision flow, the Graph app (/graph) can map tool calls to their Reversibility Class and show where guards intervene.

By making the recovery contract a first‑class artifact, developers gain clearer auditability and can more confidently enable autonomous tool usage.

What are the limitations and next steps?

The authors acknowledge several constraints:

  • The registry reflects a snapshot (commit 72faa608, version 0.7.0) and does not automatically stay up‑to‑date with evolving tools.
  • Native MCP annotations are untrusted; the study shows substantial mismatches, but it does not resolve which source is more reliable.
  • The evaluation focuses on controlled environments; real‑world deployments may encounter unpredictable side‑effects, network latency or user‑generated disclosures that fall outside the declared model.
  • The current specification treats disclosure as irreversible, which may be overly conservative for some privacy‑preserving scenarios. Future work could explore dynamic combination with runtime inverse‑search mechanisms like POLAR, improve automated capture of prior state, and extend the taxonomy to include probabilistic confidence in recovery.

Source: https://arxiv.org/abs/2611.22075

Frequently asked questions

How does an R2 classification differ from R1?

R1 requires that the exact prior state be restorable, meaning a full snapshot and write permission are available. R2 allows a bounded difference that the principal accepts as compensation; the system may restore most of the state but some minor residue remains, as illustrated by the SQLite AUTOINCREMENT experiment.

Can the Reversibility Class system be combined with existing tool‑level annotations?

Yes. The authors compare their registry with native MCP hints and find many mismatches. A deployment can use the Reversibility Classes as a stricter overlay, applying the classifier after reading existing annotations to enforce a higher safety guarantee.

What role does the session guard play during agent execution?

The session guard acts as a runtime gate that queries the classifier for each tool call. If the call’s class exceeds the configured policy (e.g., an R4 action when only R0–R2 are allowed), the guard blocks the call or prompts for explicit approval, thereby preventing potentially irreversible actions.


Source: Grafy Research Lab — Can You Undo It? Reversibility Classes for AI Agent Actions