Undo for AI agents: a draft spec for taking back what an agent already did
A sales agent is tidying up the Q4 pipeline. It marks deal D-881 as Won in the CRM, books a kickoff meeting with the customer, and emails their buyer a welcome note. An hour later you notice it picked the wrong deal. The customer hasn't signed. To clean up, you open three systems, work out what changed, put back the deal stage (unless a colleague has edited it since), cancel the meeting (which…
In the latest draft specification, the author introduces a "Journal" feature for AI agents to correct mistakes they've already made. This journal acts as a reverse mechanism for independent tools the agent uses. Currently, there's no way to reverse actions taken by different systems that the agent calls upon. The Journal would sit between the agent and these tool servers, usually an MCP gateway, and require no changes to the agent itself.
Each effect or action taken by the agent would come back with an undo capability. When a tool server supports the journal, it would include three additional elements: what changed, a token to reverse it, and how long reversal is possible. The journal works with any MCP server right away, and improves as more servers add undo capabilities.
To grant autonomy, the author proposes declaring each operation's undoability. Operations can be marked as reversible or irreversible, with an approver (like a human) needed for irreversible actions. Once an operation is reversible, the agent can proceed without human approval, but irreversible operations require human intervention before execution.
If an operation needs to be undone, the Recorder ensures dependent steps are handled properly, checks each step for reversibility, and builds a Reversal Plan. If any part of the Reversal Plan fails, it doesn't undo anything else that would depend on that failed step. The outcome of the undo process is recorded with details of what was reversed, what couldn't be undone, and what needs to be done to remedy the situation.
The author also emphasizes that undoing actions shouldn't overwrite newer human work. If other users have made changes to the same data, the undo operation must be denied to prevent losing their work. Finally, the author mentions that while the Journal system doesn't handle reads or provide a redo function, it is a draft specification that builds on the previous version (v0.1) and outlines changes needed for its implementation.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.