Stopping an agent ends the run. It doesn’t release the slot the agent reserved or take back the message it sent. For each action the agent can take, decide before launch whether it can be reversed, who decides and how you’ll confirm the result.
Can’t it just retry, or roll everything back?
A retry can repeat a step that already worked, and the customer gets the same message twice. Rolling back assumes nothing has changed since, when a colleague may have edited the record in the meantime. Some effects can’t be reversed at all: the customer has read the email.
1. List what each step leaves behind.
Go through the task one action at a time and write down what exists afterwards: a reservation, a sent message, a changed record, a charge. Where you choose the order, put the steps that can’t be reversed last.
2. Sort the effects by how they can be put right.
Can be reversed. A reservation can be released if it still stands and someone has the authority to release it. Check its current state first.
Can only be corrected. A sent message stays sent. Agree what a correction says and who sends it.
Changed by a person since. Keep the later change. Don’t restore an old version of the record over it.
A fictional example: a service visit.
- Step 1
- The agent reserves a technician’s slot. Done.
- Step 2
- It emails the customer the appointment. Done.
- Step 3
- It checks that the part is in stock. The stock system doesn’t answer and the run stops.
- What remains
- A reserved slot, and a customer expecting a visit.
- Recovery
- A coordinator checks the stock by hand and finds the part is out. The coordinator confirms the slot hasn’t changed, releases it and sends the customer a correction with the next step.
- Afterwards
- The stock check moves ahead of the email.
3. Rehearse a failure partway through.
In a test environment, stop the run after the second step. Check that the record of completed steps matches what is in each system. Then make the recovery fail as well, and see whether the unfinished item stays visible, the owner is alerted and the evidence needed to finish is kept.
4. Check the current state, then retry, continue or reverse.
Retry only a step that is safe to repeat. Continue when the failed step can be finished another way. Reverse or correct the earlier steps when they shouldn’t stand. Name who makes that call for each kind of failure.
Write a recovery line for each action.
- Action
- What the agent does.
- What it leaves behind
- The record, message or commitment that exists afterwards.
- Putting it right
- Reverse, correct or leave, and who decides.
- Confirmation
- Where someone reads the result.
Practical check: Put a failure that happens halfway through into the test set before the agent’s first live action.
Read more: How Do You Know an AI Agent Actually Finished the Task? · What to Plan for When an AI Agent Stops Working · Answer, Prepare or Act: How Much Should an AI Agent Do?
The example is fictional. What can be reversed depends on your own systems and business rules, and a recovery can fail too. This is general guidance, not advice for your situation.