Agentic AI / TECHNICAL PERSPECTIVE

AI Agent Failure Recovery: What Happens When an Agent Gets Stuck?

An AI agent can fail halfway through a business process and leave real work unfinished. Learn how AI agent failure recovery uses checkpoints, safe retries, reconciliation and human oversight to protect customers, prevent duplicate actions and restore reliable operations.

AI Agent Failure RecoveryAgentic AIDurable executionIdempotencyWorkflow orchestrationHuman oversightAgent reliability
REFERENCE WORKFLOW05 stages
01Detect failure and preserve the workflow's last verified state
02Establish whether the attempted action took effect in the business system
03Classify the failure and check permissions, retry limits and deadlines
04Retry safely, resume from a checkpoint, use an approved alternative or escalate
05Reconcile the final business outcome and record recovery evidence
EXECUTIVE SUMMARY

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.

01 PRACTICAL GUIDANCE

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.

02 PRACTICAL GUIDANCE

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.

03 PRACTICAL GUIDANCE

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.

04 PRACTICAL GUIDANCE

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.

05 PRACTICAL GUIDANCE

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.

06 PRACTICAL GUIDANCE

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.

07 PRACTICAL GUIDANCE

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.

08 PRACTICAL GUIDANCE

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.

09 PRACTICAL GUIDANCE

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.

10 PRACTICAL GUIDANCE

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.

11 PRACTICAL GUIDANCE

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

WORKED EXAMPLE / SAMPLE DATA

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.

Original refund confirmed£80 refunded once

Record the confirmed transaction reference and complete the remaining customer-service steps without submitting another refund.

Original refund definitively rejected£0 refunded

Identify the rejection reason. Retry only if the operation remains authorised, the error is retryable and the payment provider's contract permits it.

Outcome still uncertainPending reconciliation

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.

IMPLEMENTATION CHECKLIST

Put the approach into practice

  1. 01Catalogue agent tools and classify each action by business impact, repeatability, authorisation and reversibility.
  2. 02Implement durable workflow state and a persistent record of consequential actions, using stable operation identifiers.
  3. 03Define error-specific recovery rules, retry budgets, safe alternatives and explicit escalation conditions.
  4. 04Test crash recovery, duplicate requests, expired approvals, unsuccessful compensation and uncertain external outcomes.
  5. 05Monitor verified completion, recovery duration, unresolved cases, duplicate side effects and recovery costs; assign an accountable owner for exceptions.
COMMON QUESTIONS

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.

CONTINUE EXPLORING

Related articles

Continue through the same expertise domain or explore another perspective.

Agentic AI
Puneett Bhatnagr · 14 min read

AI Agent Evaluation Framework: Can You Trust Your Agent to Act?

Learn how to evaluate AI agents beyond response accuracy, using verified task outcomes, tool-use checks, safety controls, reliability tests and business performance metrics before granting autonomy.

AI agent evaluation frameworkAgentic AIAgent reliabilityTool-use evaluationAI agent safetyAgent observability
Read article
Agentic AI
Puneett Bhatnagr · 12 min read

AI Agent Identity and Access Control: Who Can Your AI Act For?

AI agents can access business systems and take actions. Learn how distinct identities, scoped permissions, delegated authority and human approvals keep enterprise AI agents accountable and secure.

AI agent identityAccess controlWorkload identityLeast privilegeDelegated authorisationAgentic AI security
Read article
Agentic AI
Puneett Bhatnagr · 14 min read

AI Agent Memory Design: What Should Your AI Actually Remember?

Design AI agents that resume work, remember relevant context and respect privacy. Learn how to manage memory, prevent stale decisions and evaluate business value.

AI Agent Memory DesignAgentic AILong-term memoryContext engineeringAgent state managementMemory securityAI agent evaluation
Read article
Agentic AI
Puneett Bhatnagr · 14 min read

AI Agent State Management: How Agents Finish What They Start

Learn how AI agent state management keeps enterprise workflows reliable, prevents duplicate actions, supports human approvals and helps agents recover safely.

AI agent state managementAgentic AIAgent memoryDurable executionWorkflow checkpointingHuman-in-the-loopIdempotencyAgent orchestration
Read article
Agentic AI
Puneett Bhatnagr · 12 min read

AI Agent Tool Calling: How AI Moves from Answers to Actions

Learn how AI agent tool calling connects language models to business systems, automates tasks and keeps permissions, approvals, reliability and costs under control.

AI agent tool callingFunction callingAgentic AIEnterprise API integrationAI agent securityHuman approvalWorkflow automation
Read article
Agentic AI
Puneett Bhatnagr · 11 min read

Agent Planning and Task Decomposition: How AI Gets Work Done

Discover how AI agents turn complex goals into manageable tasks, coordinate tools, adapt to setbacks and deliver verifiable business outcomes within controlled limits.

Agent planningTask decompositionAgentic AIAI orchestrationTool callingHuman oversightAgent evaluation
Read article
Agentic AI
Puneett Bhatnagr · 12 min read

Human-in-the-Loop AI Agents: When Should People Step In?

AI agents can handle repetitive work without handing over every business decision. Learn how to design meaningful human approvals, manage exceptions and measure the value of supervised automation.

Agentic AIHuman-in-the-loop AI agentsHuman oversightAgent orchestrationTool callingApproval workflowsAI agent securityWorkflow automation
Read article
Agentic AI
Puneett Bhatnagr · 14 min read

LLM Model Routing Strategies: The Right Model for Each Task

Effective LLM routing matches model capability to business requirements. Explore evidence-backed strategies for balancing inference cost, response quality, latency, resilience and enterprise governance.

LLM model routingAI gatewaysModel cascadesInference costsLLM evaluationMulti-model architecture
Read article
Agentic AI
Puneett Bhatnagr · 13 min read

Model Context Protocol Architecture: How AI Connects to Your Business

Discover how Model Context Protocol (MCP) connects AI agents to enterprise data and tools, where reusable integrations create value, and how to control permissions, actions and operational risk.

Model Context ProtocolMCP architectureAgentic AIEnterprise AI integrationAI tool callingAgent security
Read article
Agentic AI
Puneett Bhatnagr · 11 min read

Single-Agent vs Multi-Agent Systems: When Is One AI Agent Enough?

Should your business use one AI agent or a team of specialists? Compare single-agent and multi-agent systems, their costs, risks and practical enterprise use cases.

Single-agent systemsMulti-agent systemsAgentic AIAI agent orchestrationEnterprise AI agentsAgent evaluationAI workflow automation
Read article
Agentic AI
Puneett Bhatnagr · 11 min read

Why AI Agents Become Slow and Expensive — and How to Fix It

AI agent cost and latency optimisation starts with the entire workflow. Learn to cut unnecessary calls, control retries and measure the cost of successful business outcomes.

AI agent cost and latency optimisationAgent orchestrationToken efficiencyAgent observabilityWorkflow automationAI unit economics
Read article
LET'S CONNECT

Let’s build something with AI.

I welcome conversations about enterprise AI, strategic advisory, executive leadership and research collaboration.

Use the inquiry form below
  • AI engineering and enterprise architecture
  • Responsible AI and model risk
  • Executive opportunities and consulting
  • Research and technical collaboration
AI collaborationA message connects enterprise AI strategy, AI engineering and responsible governance.AI COLLABORATIONConnectStrategyEngineeringGovernance

Send me an inquiry

Tell me about your AI challenge, leadership opportunity or research idea.

Please do not include confidential business data.

Enter the answer to confirm you are human.
Let’s connect

Explore the portfolio

Search the eight expertise pages, selected case studies and research records.