AI AGENT EXECUTION SAFETY / MCP IDEMPOTENCY

THE SAME ACTION
SHOULD HAPPEN
ONCE.

Once is AI agent execution-safety infrastructure for MCP tools and applications that need safe retries after ambiguous outcomes. Stable identity. Durable state. Provider reconciliation. Protect supported refunds, bookings, payments and other consequential writes from unsafe duplicate execution after timeouts, lost responses and retries.

MCP / AGENT INSTALL npx -y @once-agent/mcp
ONCE / EXECUTION CORE LIVE
OPERATION op_8F21
ATTEMPTS 02
SIDE EFFECTS 01
LEDGER STATE CONFIRMED
LIVE ONCE NETWORK
—
protected operations
CONNECTING TO PRODUCTION
REPRODUCIBLE EVIDENCE

Different framework. Different retry machinery.
Same recovery protocol.

The same frozen Once V4 recovery core has been exercised under hard process termination across independent execution models. The control duplicates the external effect; the protected paths reconcile or fail closed instead of blindly executing again.

CONTROL / NAIVE RETRY DUPLICATED
2 external effects Fresh-process replay without an execution-safety boundary.
LANGGRAPH LAB CONFIRMED
1 external effect Real StateGraph + SqliteSaver crash/resume path with reconciliation.
CREWAI LAB CONFIRMED
1 external effect Native BaseTool boundary + explicit fresh-process redispatch.
UNKNOWN OUTCOME BLOCKED → CONFIRMED
1 effect, zero blind replay Provider truth unavailable → fail closed → reconcile when truth returns.
Audit the architecture yourself.

Install Once in a project or inspect the hard-crash labs line by line.

Scope: reproducible framework-level evidence using simulated provider ledgers and the SQLite reference backend. This is not a claim of universal exactly-once execution.

AGENT ROUTING EVIDENCE

171 decisions.
171 correct.

Gemini, Claude and Grok were evaluated across six blind runs using two fixed Once routing-conformance suites, including a 40-case adversarial suite designed to test harder execution-safety boundaries.

MODEL FAMILIES 3
Gemini / Claude / Grok Three model families, each tested in separate fresh sessions.
BLIND RUNS 6 / 6 PASS
Two fixed suites 17-case baseline plus 40-case adversarial routing conformance.
ROUTING DECISIONS 171 / 171
100% on the fixed suites All evaluated scenario decisions matched the hidden expected routes and actions.
OBSERVED ERRORS 0
No recorded routing errors Zero over-routes, under-routes, action mismatches or runtime-state mismatches.
Inspect the evidence trail.

Read the methodology, integrity hashes and aggregate results behind the six blind runs.

Scope: these results demonstrate conformance on the two fixed test suites in these six blind runs. They do not establish universal model correctness, guarantee routing for every real-world operation, or claim universal exactly-once execution.

01 · FAILURE

The provider succeeded.
The agent doesn't know.

The dangerous case is not an obvious failure. The external action happens, but the response disappears. From the agent's point of view, success and failure can now look identical.

01 AGENT Send action
02 PROVIDER Effect executed
03 RESPONSE Lost / timeout
04 RETRY Duplicate risk
FAILURE MODE A timeout does not prove the action failed.
02 · IDENTITY

Attempts change.
The operation does not.

Once identifies the real-world operation, not the individual request. Every retry of the same logical action carries the same stable operation ID.

ATTEMPT 01
ATTEMPT 02
ATTEMPT 03
STABLE OPERATION refund:order_123 op_8F21
→
EXTERNAL EFFECT 01 NOT 03
EXTERNAL EVIDENCE / 01
IETF / RFC 9110 / §9.2.2

RETRY ≠ SAFE

HTTP distinguishes idempotent operations because a communication failure can leave the client needing to retry without knowing whether the first request already took effect.

RFC 9110 says a client should not automatically retry a non-idempotent request unless it can know the retry is safe or determine that the original request was never applied.

READ THE STANDARD ↗
03 · ONCE

The retry gets a decision.
Not another blind execution.

Once places durable execution state between the retrying agent and the provider performing the consequential operation.

01
ID

Stable identity

One deterministic identity for the logical operation.

→
02
DB

Durable state

Execution history survives requests, processes and retries.

→
03
?

Provider truth

Reconcile what can actually be established.

→
04
1×

Safe decision

Suppress the duplicate or fail closed.

THE ONCE DECISION MODEL

The retry gets a decision.
Not another blind execution.

Once does not treat a missing response as proof that nothing happened. It carries the same logical operation identity across retries, checks durable state and provider truth on supported paths, then chooses one of three outcomes.

CONFIRMED REPLAY / SUPPRESS
Reality already changed. Return the durable result or suppress the duplicate instead of executing the consequential action again.
ABSENT EXECUTE
No prior effect is established. When durable state and supported reconciliation establish absence, the operation may proceed.
UNKNOWN BLOCK + RECONCILE
Truth cannot be established yet. Fail closed rather than guess. Reconcile provider truth before another consequential execution is allowed.
CORE RULE SAME OPERATION ID
A timeout is not a result. Retries reuse one stable logical identity so Once can reason about the operation rather than treating every attempt as new work.

Scope: Once does not infer provider truth from a lost response. Safe recovery on supported paths depends on durable operation identity, durable state and authoritative reconciliation or equivalent downstream guarantees.

WHERE ONCE SITS

MCP helps the agent choose the protection.
The runtime enforces the decision.

Once separates agent-facing discovery and setup from the execution-safety boundary. The MCP server helps an agent assess a project, plan protection, apply supported setup and verify the connection. The runtime is what executes, replays or blocks a protected consequential operation.

MCP / AGENT LAYER ASSESS + CONFIGURE
Discovery, planning and verification. Agents can inspect the project, explain retry risk, plan setup, apply supported protection and verify Once is connected.
RUNTIME LAYER EXECUTE + REPLAY + BLOCK
The execution-safety boundary. Protected operations use stable identity, durable state and supported reconciliation to decide whether to execute, replay or fail closed.
DATA PATH APPLICATION -> ONCE -> PROVIDER
Protection sits on the consequential path. The runtime must be on the path of the side effect being protected. Installing the MCP server alone does not automatically guard every tool call.
BOUNDARY NO MAGIC INTERCEPTION
Explicit integration, explicit guarantees. Once protects supported operations that are wired through its execution boundary; it does not claim to intercept arbitrary external actions automatically.

In short: MCP makes Once legible and usable to agents. The runtime is the safety boundary that protects the consequential operation.

CURRENT TRUST BOUNDARY

Know what Once sees.
Know how failure behaves.

The current hosted SDK path is intentionally explicit about its boundary. Protected execution is authenticated to the Once service, operation data crosses that boundary, and the SDK fails with an error rather than silently bypassing Once when the service cannot be reached.

HOSTED EXECUTION PATH AUTHENTICATED
The SDK talks to the Once service. On the hosted execute path, the operation ID, provider alias and action payload are sent to the configured Once API using the Once API key.
PROVIDER REGISTRATION EXPLICIT SETUP
Provider access is configured, not inferred. For the current hosted HTTP provider setup, the provider base URL and provider token are registered with Once so the runtime can execute and reconcile supported protected operations.
ONCE UNREACHABLE ERROR / NO SILENT BYPASS
Protection does not disappear quietly. The SDK performs bounded network retries. If Once still cannot be reached, it raises a timeout or network error instead of silently sending the protected action directly to the provider.
REFERENCE EVIDENCE LOCAL SQLITE LABS
The crash labs are reference implementations. LangGraph and CrewAI evidence uses the SQLite reference backend and simulated provider ledgers. That proof is deliberately scoped separately from the hosted Once service.

Scope: this describes the current hosted SDK execution path and the published reference labs. It is not a claim about undocumented storage location, retention, encryption, compliance or deployment guarantees. Those should be documented separately before they are promised.

WHY ONCE

Keep provider idempotency.
Add recovery when the caller no longer knows.

Once is not a replacement for provider-native idempotency, database constraints or durable workflows. Those controls remain valuable. Once focuses on the retry boundary around a consequential external operation: one stable logical identity, durable execution state and a safe decision after an ambiguous outcome.

PROVIDER IDEMPOTENCY KEEP IT
Deduplicate at the provider boundary. When a provider supports an idempotency key or equivalent control, use it. Once complements that downstream protection rather than asking you to remove it.
ONCE IDENTITY + STATE + RECONCILIATION
Reason about the logical operation across attempts. Once carries stable operation identity across retries, records durable state and uses supported reconciliation to choose execute, replay or block instead of treating a lost response as a fresh action.
DATABASE / OUTBOX DIFFERENT BOUNDARY
Protect local state and message handoff. Unique constraints, transactions and outbox patterns can protect application or messaging boundaries. They do not by themselves establish whether an external provider already performed an operation after the response was lost.
DURABLE WORKFLOW STILL NEEDS SAFE EFFECTS
Durable orchestration and safe side effects solve different layers. A workflow engine can persist and retry a step. The external side effect still needs stable identity, downstream idempotency or reconciliation when execution crosses a failure boundary.

Rule of thumb: keep every useful downstream guarantee. Add Once when the same consequential operation may be retried, the first outcome can be ambiguous, and blindly executing it again would be unsafe or costly.

CURRENT SUPPORT

Know what is proven today.
Know what still requires manual integration.

Once deliberately separates detection from protection. The scanner can identify a wider set of consequential operations than the current Runtime HTTP execution contract protects automatically. Unsupported shapes fail closed or require an adapter instead of being presented as covered.

RUNTIME HTTP V0.1 PROVEN PROTECTED SHAPE
POST + application/json + stable identity. The current proven Runtime HTTP path protects an explicitly configured target, requires a non-empty valid JSON body and supports stable identity through an idempotency key or an application resolver.
HTTP RESPONSE REPLAY REQUIRED ON RUNTIME SETUP
Confirmed retries return durable application-visible results. Runtime HTTP setup pins the exact target URL and requires durable sanitized response replay for the registered provider version before the protected operation can use the confirmed replay path.
OTHER WRITE SHAPES ADAPTER / MANUAL REVIEW
Classification is broader than automatic execution support. PUT, PATCH and DELETE may be recognized as consequential, but Runtime HTTP v0.1 does not claim a proven protected execution contract for those methods. Unsupported request shapes are rejected rather than silently treated as protected.
SCAN + AUTO-APPLY CONSERVATIVE
Finding a candidate is not the same as protecting it. The scanner runs locally and can surface likely side effects. Automatic application is intentionally narrow: only a fully revalidated eligible callsite is patched; ambiguous or unsupported cases stay manual.

Current boundary: Once does not claim that every provider, HTTP method, request shape or detected side effect is automatically protected. Provider-specific guarantees and automatic transformation support should be evaluated separately from detection.

EXTERNAL EVIDENCE / 02
STRIPE / IDEMPOTENT REQUESTS
24+ HOURS

Stripe supports idempotency so a request can be safely repeated after a connection error without accidentally performing the same operation twice.

Stripe also documents that idempotency keys may be removed automatically once they are at least 24 hours old.

STRIPE API REFERENCE ↗
04 · PROOF

Two attempts.
One external effect.

A Customer Zero regression sends the same supported consequential operation twice using one stable operation ID, then checks authenticated provider truth.

CUSTOMER ZERO / PROVIDER TRUTH VERIFIED
attempts 2
ledger_state CONFIRMED
side_effects 1
provider_executed true
02 ATTEMPTS
01 EXTERNAL EFFECT
EXTERNAL EVIDENCE / 03
AWS CLI V2 / STANDARD RETRY MODE

3 TOTAL
ATTEMPTS

01 INITIAL REQUEST
↓
02 RETRY
↓
03 RETRY

AWS CLI v2 Standard retry mode has a default maximum of two retry attempts.

Including the original call, that produces three total call attempts by default.

AWS DOCUMENTATION ↗
05 · TESTER / SCALE COMPARISON

Put your own traffic through the model.
See the retry problem at your scale.

Feed the same consequential traffic into both sides. The left models blind retry execution. The right models Once on the confirmed replay path. Use your own call volume — from one action to ten billion.

THE POINT Once doesn't stop your agents retrying. It makes retries safe.
ONCE / CUSTOMER SCALE TESTER Without Once vs With Once
IMPACT MODEL / NOT PROOF
TRAFFIC PRESETS
RETRY RATE

This is a client-side impact model, not proof. Enter 10B and the browser performs arithmetic — it does not send 10B requests. The live proof environment is linked below.

WITHOUT ONCE Blind retry
RE-EXECUTE
INCOMING ATTEMPTS / MONTH 10,010,000 original calls + retries
PROVIDER EXECUTIONS / MONTH 10,010,000 modeled · if every retry is executed again
RETRY EXECUTION OPPORTUNITIES 10,000 same logical work arrives again
VALUE THROUGH RETRY AMBIGUITY £750,000 not a savings claim
DECISION Retry the call and hope the first attempt did not already take effect.
WITH ONCE Safe retry path
REPLAY / BLOCK
INCOMING ATTEMPTS / MONTH 10,010,000 same traffic, same retry pressure
PROVIDER EXECUTIONS / MONTH 10,000,000 modeled · confirmed replay path
RETRIES INTERCEPTED 10,000 replay instead of execute again
BLIND RE-EXECUTIONS 0 on confirmed replay path
DECISION CONFIRMED → replay. ABSENT → execute. UNKNOWN → block rather than guess.
AT YOUR SCALE 10,000 modeled retries handled without blind re-execution on the confirmed replay path. £750,000 of payment value passes through those retry events. This is exposure context, not a claim that every retry becomes a duplicate charge. Annualized exposure context: 120,000 retry events; £9,000,000 of payment value passes through retry-exposed operations.
OPEN LIVE PROOF ↗
What the left side means: it deliberately models the dangerous baseline where a retry is blindly sent to a non-idempotent provider and executes again. Real providers may have their own protections.
What the right side means: the execution count reflects Once's confirmed/replay path. Once does not claim generic exactly-once execution; uncertain outcomes are designed to fail closed rather than be blindly retried.
EXTERNAL EVIDENCE / 04
GOOGLE CLOUD / PUB/SUB

AT-LEAST-
ONCE

MESSAGE 8472 DELIVERED
MESSAGE 8472 DELIVERED AGAIN

Pub/Sub provides at-least-once delivery by default.

Google documents that this means a message can be delivered multiple times, including some cases where it was already acknowledged.

GOOGLE CLOUD DOCUMENTATION ↗
06 · PLAYGROUND

Don't take the claim on faith.
Break it yourself.

The live Once Playground deliberately creates the ambiguous retry path: the provider performs the action, the response becomes uncertain, and the same stable operation is retried.

LIVE ONCE PLAYGROUND Verified retry environment
LIVE
ONCE STATE CONFIRMED
EXECUTION ATTEMPTS 2
ACTUAL SIDE EFFECTS 1
FAILURE MODEL AMBIGUOUS RETRY
Open Live Playground Stripe test mode · no real charge
07 · DEVELOPERS

Go from project
to protected operation.

Using Once through an MCP client or AI agent? Use the MCP install below. Embedding Once directly in an application? Choose the TypeScript or Python SDK below. The terminal workflow beneath is the TypeScript / CLI path for inspecting consequential operations locally, reviewing proposed protection, then applying supported transformations. Install the TypeScript SDK above before using the shorter CLI commands after Doctor.

MCP / AGENT INSTALL npx -y @once-agent/mcp
APPLICATION SDK / TYPESCRIPT npm install @once-agent/sdk
APPLICATION SDK / PYTHON pip install once-agent-sdk
TypeScript / CLI @once-agent/sdk 0.1.10
$ npx --yes --package=@once-agent/sdk once doctor .
$ npx --yes --package=@once-agent/sdk once doctor . --protect
$ npx --yes --package=@once-agent/sdk once protect .
$ npx --yes --package=@once-agent/sdk once setup . --plan
$ npx --yes --package=@once-agent/sdk once protect . --apply
ONCE / UPDATES

Stay ahead with Once.

Product updates, new integrations, research and occasional offers — straight from the team building safer AI execution.

DOUBLE OPT-IN · UNSUBSCRIBE ANYTIME
Almost there — check your inbox and confirm your email to join Once updates.

By joining, you agree to receive Once product updates, integration news, research and occasional offers. Double opt-in. Unsubscribe anytime.

ONCE / 1×

Your agents will retry.
Their side effects don't have to.

Execution safety for consequential AI-agent operations.