A customer-facing AI agent should know what to do when a connected tool fails. The safest answer is often not “try again immediately.” For actions such as refunds, cancellations, address changes and account updates, the first question is whether the outcome is truly failed or simply unknown.

Illustrative example: a customer asks for a $68 refund on an eligible return. The agent checks the return scan, confirms the amount is within its routine limit and sends the refund request to the payment system. The request times out. The agent does not receive a confirmation page, but the payment system may have processed the refund.

If the agent immediately retries, the customer could receive two refunds. If the agent tells the customer the refund failed, that may be wrong. Tool-failure planning is the work of deciding when to pause, how to verify status and who owns the next step. In the fictional Northstar example, payments support investigates payment status and the support operations manager owns unresolved recovery or escalation decisions.

Separate Confirmed Failure From Unknown Outcome

A confirmed failure means the system has returned a reliable result that the action did not happen. For example, the payment system might reject the refund because the transaction ID is invalid, the amount exceeds the available captured amount or the payment destination is not eligible. The agent can report the failure only if the business has decided that message is allowed and the failure is clear.

An unknown outcome is different. A timeout, dropped connection or missing response may mean the request failed before the payment system received it. It may also mean the payment system processed the refund but the confirmation never returned. Unknown outcome should trigger a transaction-status check, not an immediate retry. The default should be no automatic retry unless the integration provides documented duplicate-action protection and a safe retry procedure.

This distinction is familiar in distributed systems. The IETF HTTP Semantics standard defines idempotent methods as requests where repeating the same request has the same intended effect as making it once. Many business actions, including refunds, are not automatically safe to repeat unless the system is designed to recognize duplicate requests. The HTTP method alone does not make a refund safe to retry.

Illustrative refund workflow. A refund request times out, then the system checks transaction status using the original order, amount, destination and request ID. The status check branches to completed, confirmed failed without execution and unknown or conflicting outcomes. Completed means do not retry. Confirmed failed means bounded retry only if still authorized and safe from duplicate execution. Unknown or conflicting means keep paused and escalate to payments support and the support operations manager. Retry rule says retries remain within the original permission and valid approval, and idempotency keys must follow provider rules.
When a refund request times out, the agent should check transaction status before retrying. A completed refund should not be retried; a confirmed failed request can be retried only if still authorized and safe from duplicate execution; unknown or conflicting status stays paused and escalates.

Pause Before Retrying Money, Inventory or Account Changes

The permission plan should say which tool failures pause execution. A refund timeout, shipment-change timeout or account-ownership mismatch should not be treated like a harmless search error. The agent should preserve the request, stop related execution and check status through an approved path.

For the fictional refund, the next step is a transaction-status check using the original order ID, refund amount, payment destination and request identifier. If the payment system shows the refund completed, the agent should not retry. If the payment system conclusively shows that the request failed without executing, a bounded retry may proceed only while evidence, permissions and approval remain valid. If status remains unknown or records conflict, the action stays paused. Payments support investigates payment status, and the support operations manager owns escalation. Investigating a transaction does not grant new refund approval authority.

Use Duplicate-Action Protection

Duplicate-action protection means repeating the same logical payment operation should not create another business action. In plain language: clicking, calling or retrying the same refund should not issue a second refund for the same order and amount.

One common technical pattern is an idempotency key: a unique identifier attached to a request so the receiving system can recognize a retry of the same operation. Stripe’s API documentation describes idempotent requests as a way to retry safely without accidentally performing the same operation twice. AWS also discusses idempotent API design as a way to make retries safer when responses are lost or uncertain.

The business team does not need to design the API, but it does need to ask whether duplicate-action protection covers the actual payment operation. The permission plan can say that each refund execution must carry a request ID, order ID, amount, payment destination and approval reference when approval is required. The system should use those details to detect duplicates and return the original status instead of creating another refund. Where a provider uses an idempotency key, the implementation should follow the provider’s documented rules for reusing that key for the same operation. Generating a new key after a timeout can defeat duplicate protection.

Keep Retries Bounded and Within the Original Permission

A retry should not expand the agent’s authority. If the agent was allowed to issue a $68 refund to the original payment method, a retry is still limited to that same amount, order and destination. If a shift lead approved a $120 exception for one order, the retry must stay within that exact approval. It does not authorize a different amount, a different order or a different payment method.

Retries should also be bounded. That may mean one automated status check, one retry after a confirmed failure or no automated retry at all for high-impact actions. If the action still cannot be confirmed, the agent should route the case to payments support and the support operations manager rather than looping.

Plan for Unavailable Status Checks and Conflicting Records

Sometimes the status check is unavailable. Sometimes records conflict: the commerce platform shows “refund pending,” the payment system shows no completed transaction and the customer has received no email. The agent should not guess. The permission plan should name who owns the investigation and what the agent may tell the customer while the outcome is unresolved.

A practical rule might be: if the refund status cannot be verified within the approved workflow, route to the payments support queue, keep the customer request and evidence attached, and do not retry until payments support confirms the original action failed without execution and the support operations manager or another authorized approver confirms the next step when approval is required.

OWASP authorization guidance recommends server-side checks for access decisions, and OWASP logging guidance recommends recording security-relevant events in a way that supports investigation. For tool failures, the useful record includes the original request ID, status-check result, retry decision, approval reference and customer message.

Use Customer Messages That Match the Status

The agent’s customer message should distinguish pending, failed and completed actions. Those words should not be used casually. If the outcome is unknown, the agent can say the request is being checked. It should not say the refund failed or that a new refund has been issued unless the system record supports that statement.

For example:

  • Pending or unknown: “I submitted the refund request, but I do not yet have a confirmed outcome. I’m checking the transaction status before taking any further action.”
  • Confirmed failed: “The refund request did not complete. I’m routing this for review before another attempt is made.”
  • Completed: “The refund was completed to the original payment method. I’m including the transaction reference in your case record.”

These messages protect the customer experience and the business record. They also prevent the agent from promising an action it is not authorized to repeat.

Test Failure Paths, Not Only Successful Actions

A permission plan should be tested against tool failures. Test the timeout after the payment system receives the request. Test a duplicate request with the same identifier. Test a retry with a changed amount. Test a missing approval reference. Test unavailable status checks and conflicting records.

The expected result is sometimes a completed action. More often, it is a pause, a status check, a blocked retry or escalation to a named owner. NIST’s AI Risk Management Framework emphasizes measuring and managing AI risks in context. For customer-facing agents, tool-failure tests are part of that context.

Add Tool Failure Rules to the Permission Plan

When completing the permission planning worksheet, add what happens when a tool returns a timeout, an error, an unavailable status check or a conflicting record. The guide to correction and recovery can help decide when a failed or uncertain action should pause. The guide to building a complete permission plan, the guide to agent authority and the completed refunds and returns example can help decide whether retries belong under Act within limits, Request approval or Not permitted. A written plan does not guarantee enforcement, security or compliance, but it gives the implementation team a specific behavior to build and test.

Use the Permission Plan Builder to turn these decisions into a working plan.

When a timeout or retry is reviewed after the fact, compare the action record with the plan the agent was supposed to follow. How to Check Whether Your AI Agent Followed Its Permission Plan explains how to review attempted actions, approvals and verified outcomes without treating an unknown result as a confirmed failure.

Sources


One response to “When an AI Agent’s Tool Fails: Pause, Verify and Avoid Duplicate Actions”

  1. […] record before retrying; another attempt could create a duplicate refund. For more detail, see When an AI Agent’s Tool Fails: Pause, Verify and Avoid Duplicate Actions and When an AI Agent Makes a Mistake: Design for Correction and […]