Key takeaways
A timeout does not establish that an action failed; the receiving system may already have completed it.
Checkpointing protects workflow progress, but external actions need separate duplicate-prevention controls.
Retry temporary technical failures within explicit limits; do not retry business rejections or bypass access controls.
Give AI agents a defined recovery policy rather than unlimited freedom to improvise.
Measure verified task completion, recovery time, duplicate effects and cost per successful outcome, not just system availability.
Design the most consequential actions around independently enforced approval and reconciliation.
The customer received a refund. Or did they?
Imagine a customer contacting an online retailer about a damaged product. An AI agent retrieves the order, checks the returns policy, obtains the required approval and submits a refund request to the payment system. Just as the payment service processes the request, the connection drops. The agent receives no confirmation.
Should it submit the refund again? Tell the customer that the refund failed? Mark the case as resolved? Each decision could be wrong. The money might already have been refunded, while the retailer's customer-service system still shows an open case.
This is where AI agent failure recovery becomes a business capability, not simply a technical error-handling feature. Once an agent can change records, initiate transactions or coordinate work across applications, recovering from an interruption becomes as important as completing the original task.
A reliable agent does not need to succeed on every first attempt. It needs to recognise uncertainty, preserve completed work and continue safely when possible. When it cannot do so, it must leave the business with an accurate account of what happened and a clear way to resolve the problem.
Why agent failures are different from chatbot errors
A chatbot that produces an incorrect explanation may need to regenerate its answer. An agent that has already acted on that explanation may have created an external consequence. It might have booked an appointment, modified a customer record or sent an instruction to another application.
An agentic workflow also introduces decisions that conventional automation does not necessarily make at runtime. A language model might choose a tool, construct its inputs, assess the response and decide what to do next. The application must distinguish a faulty decision from a failure in the underlying technology.
AI agent failure recovery is the set of mechanisms that detect an unsuccessful or uncertain execution, establish the actual business state and restore progress without causing unauthorised or duplicate effects. It combines conventional distributed-system reliability techniques with controls for uncertain AI-generated decisions.
Recovery must therefore answer two separate questions: is the agent able to continue, and is continuing the workflow still appropriate? A restarted application may be healthy while its business process remains incomplete.
Different failures need different recovery decisions
Treating every error as a reason to retry is one of the easiest ways to make an agent less reliable. The appropriate response depends on the cause of the failure and the possible consequences of repeating the action.
Temporary service fault | Example: a read-only order lookup encounters a short network interruption | Response: retry within a defined time and attempt budget.
Uncertain transaction outcome | Example: a refund request times out after submission | Response: look up the original transaction or use the provider's supported duplicate-prevention mechanism before attempting further action.
Invalid model output | Example: the agent generates a malformed purchase-order identifier | Response: validate the input, attempt a bounded correction using trusted records, or request clarification.
Business-rule rejection | Example: the requested refund exceeds the approved amount | Response: stop the action and follow the authorised exception process.
Permission failure | Example: the agent attempts to access an account outside its permitted scope | Response: deny the operation; never change identity or tools to evade the restriction.
Persistent dependency failure | Example: an inventory service remains unavailable | Response: suspend affected operations, consider an approved alternative, or transfer the case to operations staff.
An incorrect plan can be reconsidered without replaying actions that have already taken effect. A recovery controller should track the distinction between a proposed step, an attempted step, a verified effect and an unresolved outcome.
Give the workflow a memory that survives failure
Conversation history is useful for understanding what a customer asked. It is not a dependable substitute for execution state. A conversation may say that a refund was requested without establishing whether an actual refund occurred.
Checkpointing means saving the information required to resume a workflow after an interruption. A durable execution mechanism persists progress outside the running process so that a machine restart does not automatically mean starting the task again. Official LangGraph implementation documentation illustrates how replay can restore saved task outputs while requiring application designers to protect external effects against repetition.[1]
For a refund workflow, the stored state might contain the case identifier, approved amount, completed policy checks, authorisation reference, current step, external transaction identifier and recovery deadline. Sensitive fields should be minimised, protected and retained only as required.
Keep version information for the workflow, relevant business rules and action definitions. When a paused task resumes after a deployment or policy change, determine whether the saved state can still be used. Expired approvals or changed transaction details may require a fresh decision.
A checkpoint and an external payment are separate writes unless the system explicitly coordinates them. If the payment succeeds but the worker crashes before recording the checkpoint, replay can still repeat the payment. This gap is why durable execution and safe external actions must be designed together.
How to retry without paying or emailing twice
The engineering term for a repeatable operation that produces no additional intended effect is idempotency. A refund service that supports idempotent requests can recognise a repeat submission for the same authorised refund and return the existing outcome rather than creating another refund.[2]
Assign a stable identifier to the business action before sending it. Reuse it for retries of that same action, not for a new refund or a changed amount. The receiving service must actually support and enforce the identifier, including concurrent requests and its documented retention period. Simply adding a random identifier to a request is not enough.
Use bounded retries for faults likely to disappear. Exponential backoff increases the delay between attempts; jitter introduces variation so that many clients do not retry together. Both should fit within a total deadline and a shared retry budget across the workflow.[3]
If a service remains unhealthy, a circuit breaker can temporarily block further calls instead of allowing every waiting agent to keep trying.[4] The business can then queue eligible work, offer a restricted service or hand the case to staff. A fallback system must be authorised and capable of preserving the original operation's meaning.
Where the external application has neither reliable duplicate prevention nor a trustworthy status lookup, automatically retrying a consequential write after an uncertain result may be unsafe. Keep the case pending and arrange reconciliation rather than treating the absence of a confirmation as permission to repeat it.
When continuing is better than undoing everything
Consider a procurement agent that reserves stock, creates a purchase order and requests delivery. If delivery scheduling fails after the purchase order is accepted, deleting the entire workflow history would not cancel the order.
Sometimes the right response is forward recovery: retain the confirmed order and arrange another approved delivery option. In other cases the business needs a compensating action, such as releasing a reservation or cancelling an order where contractual terms allow it.
Compensating transactions are domain-specific actions that address previously completed work. They are not the same as rolling back an uncommitted database transaction. Other business activity may have occurred in the meantime, and cancellation itself can fail.[5]
Define which steps may be compensated, which require a separate approval and which cannot be reversed. A customer email that has already been delivered cannot be unsent by restoring the agent's previous state. A corrective communication is a new action with its own authorisation requirements.
For consequential workflows, put irreversible actions after essential validations wherever practical. Preserve the original event alongside any correction so that the business can reconstruct both what happened and how it was resolved.
Keep the AI in charge of reasoning, not its own permissions
An agent may be useful at interpreting an error message, suggesting an alternative plan or summarising an exception for a human reviewer. It should not be the sole authority deciding whether a payment limit, access restriction or approval can be ignored.
Place action controls in an execution layer outside the language model. Validate tool parameters against trusted records, check the caller's permissions, enforce transaction limits and bind approvals to the specific action and its material details. Apply the same controls to every recovery attempt.
Use explicit maximums for the number of model calls, tool calls, elapsed time and spending. Repeated self-correction can consume resources without improving the outcome, particularly when the model is responding to incomplete or misleading information.
Where an agent hands work to another agent, pass the relevant execution identifiers, verified results and authorised scope. The second agent must not treat a transfer as a fresh request that resets duplicate checks or broadens permissions.
Human escalation should provide a usable case rather than a vague error message. Include the intended outcome, confirmed steps, uncertain effects, evidence locations and the decision required. Record the reviewer's decision and revalidate it before acting.
Measure recovery by business outcomes, not green dashboards
A service dashboard can show that an AI application is available even though hundreds of cases remain stuck in a payment or fulfilment queue. Recovery measurement must cover the entire workflow, including what happens in downstream business systems.
Track verified task completion rate: the share of initiated tasks that meet their final business acceptance criteria within the agreed service window. Define how pending, cancelled and failed cases enter the denominator so that unresolved cases cannot disappear from reporting.
Track automatic recovery rate: the share of failed or interrupted cases that subsequently reach a verified successful outcome without manual intervention. Report safe manual resolution separately; it is not inherently a poor outcome.
Measure recovery time from detection to restoration of an agreed business state, alongside the number and age of unresolved cases. Keep separate counts of duplicate side effects, incorrect success reports, unauthorised attempts and compensation failures.
Calculate cost per verified completed task using the attributable costs of model calls, tool execution, infrastructure, retries and human intervention, divided by the number of accepted outcomes. Compare these measures with the existing process and separate results by risk level and failure type.
A high automatic recovery rate is valuable only when the recovered work is correct. It should never be used to pressure teams into removing necessary approval checkpoints or classifying uncertain transactions as complete.
Test the moments when everything goes wrong
Before introducing an AI agent into a live business process, map the external systems it can read and modify. Identify what happens if each dependency fails before, during or after an action. For a high-impact workflow, include the process owner, engineering, security and relevant risk specialists in this exercise.
Use controlled failure injection in a test environment. Disconnect a dependency, return an invalid tool response, simulate a crash after a confirmed external write, replay a duplicate event and expire an approval while a task is paused. Also test failures during recovery itself, including unavailable reconciliation services and interrupted compensation.
Define the expected business state before every test. For an interrupted refund, the acceptance criterion is not merely that the agent restarts successfully. It is that the correct customer receives the authorised refund at most once, the outcome is verified and the case remains open if verification is impossible.
Start with a narrow workflow and a deterministic recovery policy. Introduce more flexible agent-based replanning only where it demonstrably improves completion without increasing uncontrolled actions. For stable, predictable processes, an ordinary workflow engine may already provide the reliability required.
The most useful question to ask an AI supplier is not whether its agents can recover from errors. Ask what happens when a transaction succeeds but its acknowledgement never arrives. The answer reveals whether the platform understands the difference between restarting software and restoring a business process.
Build for the day the demonstration stops working
Successful demonstrations show what an AI agent can do when the necessary systems are available and the inputs are well behaved. Operational confidence comes from understanding what it will do under less favourable conditions.
If your organisation is deploying agents across customer service, procurement, finance or operations, begin by reviewing the actions that can create real business consequences. Establish how their outcomes are verified, which actions can be repeated and who owns unresolved cases. A focused review of these controls can reveal whether your existing architecture is ready for greater autonomy or needs stronger foundations first.
The objective of AI agent failure recovery is not to make an agent endlessly persistent. It is to make every interruption manageable, every uncertain outcome visible and every subsequent action defensible.
References and further reading
[1] LangChain, LangGraph official documentation repository. Functional API: persistence, re-execution and idempotency. Source: https://github.com/langchain-ai/docs/blob/main/src/oss/langgraph/functional-api.mdx
[2] Amazon Web Services, AWS Builders' Library. Making retries safe with idempotent APIs. Source: https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/
[3] Amazon Web Services, AWS Builder Center. Timeouts, retries, and backoff with jitter. Source: https://builder.aws.com/content/3EumjoZascWd1oZiEgL8ORlv3qE/timeouts-retries-and-backoff-with-jitter
[4] Microsoft Azure Architecture Center. Circuit Breaker pattern. Source: https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker
[5] Microsoft Azure Architecture Center. Compensating Transaction pattern. Source: https://learn.microsoft.com/en-us/azure/architecture/patterns/compensating-transaction
Apply the approach
Consider an authorised £80 refund for a damaged retail order. The agent submits the request, but the payment API times out before the agent receives an acknowledgement. The following possible outcomes demonstrate why the agent must establish the original transaction's status before marking the case complete or sending a further request. The amount is assumed for this example, not a measured customer result.
Record the confirmed transaction reference and complete the remaining customer-service steps without submitting another refund.
Identify the rejection reason. Retry only if the operation remains authorised, the error is retryable and the payment provider's contract permits it.
Keep the case open. Reconcile using the original operation identifier or obtain an authorised human decision; never initiate a separate refund simply because the first request timed out.
Put the approach into practice
- 01Catalogue agent tools and classify each action by business impact, repeatability, authorisation and reversibility.
- 02Implement durable workflow state and a persistent record of consequential actions, using stable operation identifiers.
- 03Define error-specific recovery rules, retry budgets, safe alternatives and explicit escalation conditions.
- 04Test crash recovery, duplicate requests, expired approvals, unsuccessful compensation and uncertain external outcomes.
- 05Monitor verified completion, recovery duration, unresolved cases, duplicate side effects and recovery costs; assign an accountable owner for exceptions.
Frequently asked questions
Can an AI agent recover automatically from every failure?
No. Automatic recovery is suitable for faults with a known, authorised resolution. Uncertain high-impact transactions, security failures and irreversible actions may require reconciliation or human review. Some tasks must stop rather than continue.
What is the difference between checkpointing and agent memory?
Agent memory usually provides context, such as previous conversations or relevant information. Checkpointing persists execution progress so an interrupted workflow can resume. The distinction is functional: saved conversation history alone does not establish which external actions succeeded.
Does idempotency guarantee exactly-once execution?
Not across an entire workflow. A correctly implemented idempotent operation can prevent additional intended effects from duplicate requests within its defined scope and retention window. Delivery and computation may still occur more than once, and other external operations need their own protection.
Can switching to a different language model recover a failed agent?
Sometimes, if the problem is model availability or capability and the replacement is approved and evaluated. Switching models cannot establish whether an external transaction succeeded, repair an invalid authorisation or automatically make repeated writes safe.
Is a multi-agent architecture necessary for reliable recovery?
No. A single agent with a durable workflow, independent action controls and clear exception handling may be more reliable and easier to operate. Additional agents introduce coordination and state-management responsibilities that must be justified by the business use case.