Can You Undo an AI Agent’s Changes in an ERP or CRM?
You can undo some AI agent actions in an ERP or CRM, but the recovery method depends on the action and what happened afterwards. Before granting execution rights, classify each action as reversible, compensatable or irreversible. Capture the prior state, define the permitted correction, and check downstream effects: restoring a field does not necessarily restore the business process.
What does “undo” mean for a business action?
Use three categories when deciding what an agent may execute. Classify the complete action, including any automation it triggers.
| Action class | What recovery means | Conditional example | Permission approach |
|---|---|---|---|
| Reversible | Restore the earlier state without leaving an unresolved business effect | Restore a draft field if no later edit or dependent action has occurred | Allow within a narrow scope after testing recovery |
| Compensatable | Add an action that corrects the business effect while preserving the original history | Correct a posted transaction through the system’s supported reversal or adjustment process | Require a defined correction path and an accountable owner |
| Irreversible | The original effect cannot be fully withdrawn | An external recipient has already read a message | Put approval before execution or keep execution with a person |
These categories depend on your system and workflow. A CRM field change might be reversible while the record remains untouched. If that change starts an external message or a handoff, recovery must address those effects too.
Treat an action as unclassified until you have checked its dependencies. An endpoint called “delete” or “cancel” is not enough evidence that the entire action is reversible.
What should you capture before an agent makes a change?
For each permitted write, require a recovery record that connects the requested change to the state it will replace.
Capture:
- The target: the record and exact fields the agent intends to change.
- The prior state: the relevant values before the write.
- The expected version: a version value or equivalent check for intervening edits.
- The intended result: the proposed values and the reason for changing them.
- The authority: the permission or approval covering that specific action.
- The outcome: whether the system accepted the change, rejected it or returned an uncertain result.
Keep this record outside the agent’s conversational memory. Make it available to the people and recovery process responsible for correcting an error.
Capture only what recovery needs. Copying an entire customer record to preserve one field creates an unnecessarily broad data store. Apply the same access and retention decisions described in what data an AI agent should be able to see.
Prior-state capture also needs a concurrency check. If a person edits the record between capture and execution, stop and reassess rather than applying a change against stale information.
When should you use a compensating transaction?
Use compensation when restoring an old value would misrepresent what happened or when the application requires a correcting record.
For example, your ERP may require a posted transaction to be reversed, credited or adjusted rather than deleted. Confirm the supported route for the particular record type and status. Do not give an agent a generic deletion permission as a substitute for that route.
A compensation plan should specify:
- Which original action it corrects.
- Which supported transaction or operation to use.
- Who may authorise it.
- How to prevent the correction from being applied twice.
- How to verify the resulting business state.
Define recovery success in business terms. “The correction request succeeded” is weaker than “the original and correcting records are linked, and the resulting balance matches the approved outcome.”
Compensation is a separate action with its own risks. Approval to create a transaction should not automatically grant unrestricted authority to reverse transactions.
How do downstream effects change the recovery plan?
Map the effects beyond the record the agent edits. Ask whether the action can trigger messages, stock reservations, fulfilment work, reporting updates or changes in another system.
For every dependency, record:
| Dependency state | Recovery question |
|---|---|
| Queued | Can it be stopped before execution? |
| Completed internally | Is there a supported reversal or correction? |
| Passed to another system | How will the receiving system be corrected and checked? |
| Visible to an external recipient | Who will handle the correction or follow-up? |
| Unknown | How will the outcome be established before another action runs? |
Do not assume a successful correction in the ERP also corrects the CRM, a message queue or a person’s work.
Where possible, separate preparation from commitment. An agent can prepare a draft and present its consequences before receiving permission to post, send or release it. Our guide to approval steps for AI agents explains how to place that decision.
Restoring the workflow itself is a separate step; see how to roll back an AI workflow release.
What does a recovery sequence look like in practice?
Consider an illustrative workflow: an agent changes a customer’s delivery address on an open order.
Before execution, the workflow captures the old address and record version. It checks whether fulfilment has started and whether an address change triggers a notification.
Recovery then depends on what happened:
- The change is still isolated. The record has no later edits and nothing dependent has run. Restore the captured address through the application’s supported update operation, then verify it.
- A person has edited the order afterwards. Stop automatic recovery. Compare the affected fields and ask the order owner to resolve the conflict. Restoring the whole old record could overwrite valid work.
- Fulfilment has started. Correcting the address field is only part of recovery. Check whether the fulfilment instruction can still be changed and assign any remaining action to an owner.
- A message has already been read. Restoring the address does not withdraw the information received. Follow the agreed correction process and record that the original communication remains an effect of the action.
The acceptance condition should cover the order and every triggered dependency. Keep unresolved effects visible instead of marking the action recovered because one field looks correct.
What should happen when the execution result is uncertain?
Treat an uncertain result as a distinct state.
Suppose the agent submits a change but receives no clear response. Do not immediately repeat the write or launch a compensating action. First check whether the original operation completed.
Where the application supports it, use a unique operation reference and a supported way to prevent duplicate execution. Otherwise, define a reconciliation step using the application’s available records and history.
If the outcome remains unclear, pause dependent actions and route the case to a named owner. Recovery should begin from an established state, not a guess.
Which common mistakes make recovery unreliable?
Calling every change reversible. Classify the operation, record status and downstream effects together.
Restoring an entire old record. Restore only the intended fields after checking for later changes.
Treating deletion as correction. Use the application’s supported correction route for posted records.
Giving recovery broader access than execution. Restrict recovery to the relevant records, operations and approvals.
Testing only successful writes. Include conflicts, rejected corrections, repeated requests, uncertain results and partially completed workflows.
Assuming a backup is an action-level undo plan. Require proof that the proposed recovery method can correct the individual action while preserving valid later work.
Some workflows will have no acceptable automatic recovery path. Keep those actions behind approval or limit the agent to preparing a draft.
What should you verify before granting execution rights?
Use this checklist for each proposed action:
- Its reversibility class is documented for each permitted record status.
- The prior state is captured before execution.
- Later edits are detected before restoration.
- The supported correction route has been tested.
- Downstream effects have owners and recovery steps.
- Repeated requests cannot silently create repeated effects.
- Uncertain outcomes trigger reconciliation.
- Execution can be paused while unresolved cases are investigated.
- A person can verify recovery without relying on the agent’s explanation.
Start with one bounded workflow and test deliberately broken cases before expanding access. Include these recovery conditions in an AI pilot that ends in a decision.
Reversal is one step in a wider response; see what an AI automation incident runbook should contain.
Frequently asked questions
Can an agent automatically undo its own mistake?
Only where you have authorised and tested a narrow recovery operation. Require checks for later edits, dependent actions and duplicate corrections. Route anything outside those conditions to a person.
Is an audit log enough?
An audit log may help establish what happened. For recovery, also require the relevant prior values, a supported correction operation and a way to verify the final state.
Should every action require approval?
Place approval according to consequences and recovery limits. A tested, isolated draft edit may qualify for automatic execution. An action with an irreversible external effect needs a separate decision before it runs.
Can one undo button cover an entire workflow?
Only if it coordinates the required recovery steps and reports unresolved effects. Define what that button promises before offering it to users.