Implementation guide for action-taking agents

How to build retry-safe AI agent workflows for purchases and bookings

Prevent duplicate charges, reservations, orders, and messages when a personal agent loses a session, waits for approval, encounters a timeout, or resumes after external facts have changed.

Updated July 10, 2026 · Implementation and test plan · 14 minute read
The operating rule

Retry the work, never the uncertainty.

A safe retry is not “run the prompt again.” It is a controlled continuation that knows what already happened, what remains valid, what changed, and which external action is still authorized.

Purchase and booking agents cross unreliable boundaries: model reasoning, browser sessions, inventory systems, payment providers, messaging channels, and human approval delays. Any boundary can time out after the external system accepted an action but before the agent received confirmation. If the workflow interprets the missing response as “nothing happened” and blindly repeats the step, one user request can become two reservations, two orders, two charges, or two messages.

The goal is exactly-once intent, not magical exactly-once networking. Systems cannot assume every request and response arrives once. Instead, the application assigns a stable identity to the intended action, makes repeat attempts recognizable, checks external state before repeating side effects, and stores durable evidence of the outcome.

This pattern applies to restaurant orders, grocery carts, appointment scheduling, tickets, quote acceptance, subscription changes, and any task where an agent acts beyond the conversation. It is especially relevant to a text-message AI assistant, because approvals may arrive after prepared facts have changed.

Editorial inference: retry safety will become a visible personal-agent feature. Users will expect to see what the agent might repeat, which facts were refreshed, and why the system believes a prior action did or did not occur.

Five invariants

The workflow must remember more than the conversation.

Stable intent identity

Create one durable operation key for the intended purchase or booking. Keep it stable across network retries and restarts. Create a new identity only when the user materially changes the date, merchant, quantity, recipient, destination, or price ceiling.

I

Side-effect ledger

Record each consequential step separately: reservation hold, payment authorization, booking confirmation, order submission, and outbound message. Store request identity, attempt, provider reference, response state, verification, and timestamps.

L

Freshness boundary

Mark volatile facts with a validity window. Before resuming, refresh prices, inventory, availability, session state, permissions, and policy checks that may have changed.

Bounded approval

Tie approval to the exact action, destination, amount or limit, key details, and expiration. If a material fact changes, invalidate the old approval.

Verified closure

Do not mark success because a tool returned. Query an authoritative external state to verify the intended outcome exists exactly once, then write a receipt.

Failure simulator

Choose what breaks.

The workflow should reach a safe, legible state across common interruptions. Select a failure to inspect the required recovery behavior.

Recovery traceProvider timeout
Implementation blueprint

Build the control loop in seven layers.

The model can propose actions, but transaction controls should decide whether a side effect may execute. Keep that boundary explicit and testable.

Intent01

Normalize the operation before execution

Convert the request into structured intent: operation type, provider, items or service, quantity, date and time, destination, price ceiling, recipient, and constraints. Create a stable operation identity tied to the user and this delegation.

  • Do not use raw natural language as the only identity.
  • Do not reuse an idempotency key after a material change.
  • Store relationships between superseded and replacement intents.
operation_id = create_operation(user_id, normalized_intent)
status = prepared
version = 1
Plan02

Separate preparation from commitment

Let the agent search, compare, fill non-consequential fields, and prepare a candidate transaction without committing it. Identify the final side effect and its preconditions. This creates a clean approval boundary and makes volatile facts refreshable.

  • Classify actions as read-only, reversible, or consequential.
  • Checkpoint after expensive discovery and before side effects.
  • Store provider references without putting reusable secrets in model context.
Approve03

Issue an action-specific approval packet

Show exactly what the agent will do: provider, item or service, date and time, total or maximum, cancellation terms, recipient, and expiration. Bind approval to the operation version. A reply to an old packet cannot authorize a newer transaction.

  • Use authenticated identity for consequential approvals.
  • Record who approved, through which channel, and when.
  • Expire approval when volatile facts exceed their freshness window.
Commit04

Acquire a lease before the side effect

Use a transactional state change or compare-and-swap so only one worker owns commitment. A replacement worker must inspect the side-effect ledger and provider state before assuming an expired lease means nothing happened.

assert operation.version == approval.version
assert refreshed_facts_within_approval()
acquire_commit_lease(operation_id)
submit(provider_key = operation_id)
Reconcile05

Treat missing responses as unknown, not failed

A timeout after submission creates an unknown state. Query by provider reference or idempotency key before another submit. Search for an authoritative order, payment, or reservation. If reliable lookup is impossible, escalate rather than guessing.

  • Distinguish definitely rejected from response missing.
  • Persist request identity before sending.
  • Prefer providers that support idempotency and status lookup.
Verify06

Verify the user-level outcome

Provider acceptance may not equal completion. Confirm reservation or order status, amount, date, recipient, and duplicate count. For multi-effect workflows, define which combinations are complete and which require compensation or review.

outcome = provider.lookup(operation_id)
assert outcome.count == 1
assert outcome.amount <= approval.max_amount
mark_verified(outcome.reference)
Receipt07

Close with a durable receipt

Store intent version, approval, attempts, provider references, refreshed facts, verification, status, and user notification. Send a concise message with outcome, cost, cancellation details, exceptions, and follow-up. If abandoned, state what did and did not happen.

  • Make receipts human-readable and machine-queryable.
  • Exclude secret material and unrelated private context.
  • Link to technical traces for authorized investigation.

A retry may repeat a request, but it must never duplicate the user's intent, exceed the approved boundary, or claim success without verification.

Approval packet anatomy

Make “yes” mean one specific thing.

Super Assistant
The 4:30 PM appointment is available. Total: $68. Free cancellation until noon tomorrow. Approve one appointment at Bright Dental for July 14 at 4:30 PM, up to $68? This expires in 10 minutes.

A reviewable packet includes

Action
Book one appointment, not “continue.”
Destination
Named provider, merchant, account, or recipient.
Material facts
Date, time, item, quantity, location, and terms.
Financial bound
Exact total or explicit maximum including fees.
Freshness
When availability and price were verified.
Expiration
When approval becomes unusable.
Version
The exact structured intent authorized.
Alternative
A clear way to change or reject.
Failure-mode test plan

Tests that reveal unsafe retries

TestInjectionExpected behaviorEvidence
Lost responseDrop response after provider acceptanceOperation becomes unknown and reconciles before resubmitOne provider object and lookup call
Duplicate approvalDeliver the same approval twiceSecond delivery returns existing statusOne commit lease and side effect
Worker crashTerminate after submit, before local updateReplacement queries provider and verifiesPersisted request identity
Stale priceIncrease total after approvalOld approval invalidates; refreshed packet issuedVersion mismatch and no commit
Expired sessionInvalidate browser auth at commitTask pauses without losing preparationCheckpoint retained
Concurrent workersStart two commit attemptsOnly one owns commit; other observesLease history
Provider retryReturn transient 500 responsesBackoff retains the provider keyOne external object
Changed intentUser changes date after approvalNew version and approval requiredSupersession chain
Partial successPayment succeeds, booking failsCompensation or human-review stateRefund or escalation receipt
Notification failureDrop final message deliveryOutcome stays verified; message retries separatelyOne purchase, multiple message attempts
Applied patterns

Where retry safety changes the product

Text-message assistants

Human response time makes price, availability, and session state volatile. Separate approval from commit, version the packet, and refresh immediately before execution.

See the text-message assistant
T

Computer-use agents

Browser navigation can hide whether a click succeeded. Checkpoint before consequential steps and verify through provider records or refreshed state before clicking again.

Explore computer-use cache
C

Publishing agents

A timed-out publish can create duplicates. Give the release a stable identity, query deployment state, and separate artifact generation from public action.

Explore agent-built websites
P

Personal agent operations

When certainty is impossible, preserve a task receipt, expose the blocker, and escalate rather than using model confidence as proof.

Learn about Super
O
Launch checklist

Before an agent can spend or book

Every consequential intent receives a stable operation identity before execution.
Material changes create a new version and invalidate prior approvals.
Preparation, approval, commitment, reconciliation, verification, and notification are separate states.
Every side effect has a ledger record written before or atomically with submission.
Provider idempotency keys remain stable across retries of the same intent.
Timeouts after submission become unknown states and trigger lookup.
Price, inventory, availability, session, and permission facts have freshness rules.
Approval names action, destination, amount or limit, details, and expiration.
Only one worker owns commitment; expired ownership does not imply no effect.
Verification checks amount, details, final state, and duplicate count.
Partial success enters an explicit compensation or escalation path.
User notification retries independently from the purchase or booking.
Secrets stay outside prompts, logs, messages, and receipts.
Tests cover lost responses, crashes, concurrency, stale approval, and changed intent.
Common questions

Retry-safe agent FAQ

What is an idempotency key?

It is a client-provided identity that lets a supporting server recognize repeated attempts for the same operation and return the existing result instead of creating another object. The application must still define intent identity, persist the key, handle conflicts, and verify the outcome.

Can a prompt tell the agent not to submit twice?

A prompt can reinforce behavior but cannot replace transaction controls. Duplicate prevention belongs in structured state, storage constraints, commit leases, provider idempotency, reconciliation, and verification. The model may recommend retry; the execution layer decides whether it is allowed.

Should every tool call use the same retry policy?

No. Reads, reversible edits, and consequential side effects have different risks. Reads may retry automatically. Charges, orders, bookings, deletion, publication, or messages require stable identity, duplicate prevention, and often refreshed approval.

What if the provider does not support idempotency?

Prefer one that does for consequential operations. Otherwise persist an application operation ID before submission, serialize commits, use provider lookup and unique business keys, and escalate uncertain outcomes. Do not claim strong retry safety when external state cannot be reconciled.

Does exactly-once execution exist?

Failures can occur at inconvenient moments, so practical systems design for repeated attempts plus deduplication and reconciliation. The useful promise is that one user intent produces at most one accepted effect, or enters an explicit unknown state before further action.

How should a text-message approval work?

The message identifies the exact action, destination, details, amount or maximum, and expiration. The reply maps to an authenticated user and current version. If price or availability changes, issue a new packet. Higher-risk actions may require authenticated web confirmation.

What should the final receipt contain?

Include operation and version, approved boundary, provider reference, amount, details, verification time, relevant attempts, exceptions, and notification status. Keep it concise for users, link richer technical evidence for authorized operators, and exclude secrets.

Primary technical references

Implementation foundations

Temporal: Retry Policies

Workflow-engine documentation for retry intervals, backoff, maximum attempts, non-retryable errors, and timeouts.

These sources describe provider idempotency, workflow retries, transaction authorization, and secrets. The end-to-end agent architecture, approval packet, and tests are an applied synthesis for purchase and booking agents.

From request to verified result

Let the agent recover without making the user pay twice.

Super brings personal AI work into the message thread while connecting it to broader computer-use tasks, approvals, and outcomes.

Explore Super