Skip to content
News

You stopped the AI agent. Can you undo what it did?

An AI agent changes six delivery dates before anyone stops it. Follow the recovery one order at a time and use the checklist to plan for changes your own agent might make.

Waves break against stepped concrete structures under a stormy sky.

Six delivery dates change before the dispatcher stops the agent. It was supposed to prepare a list for review. Two customers already have messages confirming the new date, and a second dispatcher has corrected another order. The bulk edit is still open on screen. Restoring everything from the morning export would put one order back on a date the customer can no longer make.

You can undo some AI agent actions if the affected system can restore the previous state and you can verify it is still safe to do so. Other effects need a separate response. Stopping a Run can prevent more work from being attempted, but a confirmed change, a queued message or a customer who already saw a notice has to be dealt with where it happened. VS Code's recovery guide makes a similar distinction between restoring workspace files and recovering effects outside the workspace.

Work out which systems are still moving

The dispatch lead first stops the active job and checks whether a schedule could launch it again. She asks the messaging owner to hold any unsent notices from that batch. If the delivery app passes changes to a carrier, she checks whether those updates are queued, accepted or already used to plan a route. Each system has its own state, and canceling the agent is only the first check.

It helps to have someone own the next decision while the trail is still being assembled. One person can confirm order states while someone with authority over customer messages handles the notices. An agent with read access can help reconcile the records; have it list what it could verify and point to the receipt for each effect. A missing receipt is a reason to look at the affected system, especially when a request timed out. It doesn't tell you whether an action went through.

A raised crossing reveals hinges and support arms beneath the deck.

Recover the six orders one at a time

The dispatcher uses the order history, message log and latest route plan to sort the batch. In this example the agent changed all six dates, but the team has different evidence about what followed each change.

OrdersWhat the team knowsWhat the owner checks next
201 and 202New dates are saved and both customers received a notice.Confirm which date the team can honor and agree on a follow up before restoring or changing the orders again.
203Another dispatcher has since agreed on a different date with the customer and saved it.Leave the later change in place and note why it was excluded from recovery.
204 and 205The date changed. The messaging and route records show no downstream change.Check that the original dates are still available, then restore only those fields through the delivery system.
206The date changed, and the carrier update has no clear outcome yet.Ask the carrier owner to check whether the new date was accepted before making a second change.

Restore against the latest record. If the system offers version checks, use one so a change made after your review won't quietly get overwritten. If no such check is available, have the owner coordinate with other editors and inspect the current state again. A second date change could queue another message or amend the route again, so check what the restore itself triggers. Afterwards, read the order back and confirm that the systems using it are working from the date the team agreed on.

In software architecture, a new action that addresses the effect of a previous one is often called a compensating transaction. The delivery example shows why it can take judgment. For order 201, a clear follow up may do more for the customer than quietly reverting to the prior date. Some effects, like a delivered notice, simply remain part of the history.

Frost covers the edge of a precise metal assembly.

Rehearse the recovery before you grant write access

Pick one action your agent is expected to take and walk it through with synthetic data. A successful rehearsal should tell the person on call how to stop more changes, establish what already happened and confirm the repair. Fill in the following in the workflow's runbook:

Action and affected systems:
What the agent can change:
Where to pause new work and queued follow up:
Evidence of the previous and current states:
When restoring a value is safe:
What needs a separate response and who owns it:
What to do if the result is still unknown:
Who approves recovery and checks the final state:

Include an order edited by a person after the agent touched it and a notification you cannot retract. That will reveal more about the recovery than practicing on a row where all you have to do is change one value back. When the only safe response is manual, name the person who has access and give them enough information to make the call. Our guide to human approval for AI workflows covers when to ask before a consequential action.

Leave a record the next shift can use

Keep the original brief, the agent's recorded actions, and the recovery decision together. In Swarm, use the Run timeline and its available receipts to establish what the agent attempted, then compare that with the actual order and message records. Save which changes were restored, which were left in place and whose confirmation is still outstanding. Our AI agent audit trail guide explains how to trace that evidence back to the assignment.

Lavender covers a hillside beneath passing clouds.

The next shift should be able to tell a customer when their order will arrive without repeating the investigation. When you can hand over that answer, with the remaining exceptions clearly assigned, you've done the recovery work that a stop button cannot do for you.

Swarm | How to undo AI agent actions and recover safely