Most engineering teams building agentic workflows assume that single-use tokens prevent unintended replay. Specifications like OAuth Demonstration of Proof-of-Possession (DPoP) and RFC 9396 Rich Authorization Requests (RAR) provide mechanisms to ensure credentials cannot be reused once presented to an API. When a human approves an agent action, the system generates a credential, marks it consumed at execution time, and refuses subsequent requests carrying that same token.

That protection holds at the credential layer, but upstream in the delegation chain, a signed approval payload converts human intent into machine authority before any token exists. If your architecture tracks single-use credentials but ignores single-use approvals, one human confirmation can still trigger multiple destructive actions.

Three distinct artifacts

To understand why this breakdown happens, we need to separate the delegation lifecycle into three distinct artifacts:

  1. The signed payload. The cryptographic statement signed by the human or their client, authorizing a specific command and arguments within an explicit expiration window.
  2. The minted credential. The short-lived machine token (typically a JSON Web Token with a unique identifier, or jti) issued by an authorization server after verifying the human signature.
  3. The executed action. The state change performed by the resource server when it validates and consumes the credential.

Standard authorization libraries enforce single-use at the resource server. When the agent presents a minted token to execute an action, the resource server records the token identifier in a set of consumed credentials. A second attempt with that same token fails immediately.

The primary vulnerability sits upstream at the authorization server, where intermediate network proxies, message brokers, or agent runtimes can capture the signed approval payload before it reaches the delegation authority. An attacker presenting that payload to the minting service multiple times before signature expiry receives a fresh credential with a unique identifier on each attempt.

When the agent presents those separate tokens to the resource server, every token passes the single-use check. The human clicked approve once, yet the system executes the action several times. For an idempotent query, duplicate execution is harmless. For a destructive action, like deleting records or transferring funds, it is a silent security failure.

The multi-replica trap under stateless transport

This risk multiplies under the Model Context Protocol 2026-07-28 revision, which made the stateless core the protocol’s default (no sessions, no handshake, designed for round-robin load balancing), so the trap now describes the standard deployment rather than a hardening choice.

In a stateless deployment, requests do not pin to a single server instance. Instead, a load balancer distributes incoming tool calls across multiple identical replicas. When services maintain in-memory sets of consumed tokens, each replica operates with an isolated view of history.

If an agent or network retry sends the same signed payload to Replica 1 and then to Replica 2, both replicas verify the signature, both find an empty local cache, and both execute the operation. Every log entry looks legitimate, every token checks out as unique, and no alert triggers.

In distributed topologies, storage locality is a security boundary. Single-use enforcement must move from isolated memory buffers into a shared, durable store to preserve consent atomicity across replicas.

Closing this vulnerability requires enforcing two independent single-use checks rather than one:

  1. Credential-layer check (at the resource server). Verify that the machine token identifier has not been previously consumed.
  2. Approval-layer check (at the authorization server). Verify that the canonical hash of the human’s signed payload has not been previously exchanged for a credential.

This approval-layer check has an architectural parallel in the Cart Mandate of Google’s Agent Payments Protocol (AP2). In AP2, both merchant and user sign the Cart Mandate. The mandate binds payer, payee, a single tokenized payment method, and the exact products, destination, amount, and currency. While single-use is not explicitly mandated in the specification, the design implies that the payment system must refuse to honor a mandate twice.

Here is the pattern implemented in the reference authorization server:

canonical = canonical_authorization_bytes(
    signed.command, signed.args, signed.rar_type,
    signed.exp, signed.approver_id, signed.binding_message,
)
expected_signature = hmac.new(self._secret.encode(), canonical, hashlib.sha256).hexdigest()

if not hmac.compare_digest(expected_signature, signed.signature):
    raise SignatureMismatch("HMAC verification failed")

# Check and record the signature hash before minting the token
signature_hash = hashlib.sha256(canonical).hexdigest()
if not self._durable_state.claim_signature(signature_hash, expired_at=float(signed.exp)):
    raise SignatureReplay(
        "Signed payload already exchanged for a credential; "
        "one signature = one credential = one execution"
    )

# Issue the single-use token bound to the approved parameters
minted = self._create_credential(signed)

The authorization server computes the Secure Hash Algorithm 256-bit (SHA-256) digest of the canonical authorization bytes and attempts an atomic test-and-set claim against the durable state store before generating the token. If another replica has already processed that signature, the call raises a typed SignatureReplay exception and halts execution.

Durable coordination without complex infrastructure

Teams often hesitate to add distributed coordination because they assume it requires deploying heavy database clusters. For single-agent bridges and small fleets, a lightweight SQLite store operating in Write-Ahead Logging (WAL) mode provides the necessary atomicity with minimal operational overhead:

class DurableReplayState:
    """Atomic, cross-replica replay protection using SQLite WAL mode."""

    def claim_signature(self, sig_hash: str, *, expired_at: float) -> bool:
        now = self._clock()
        with self._lock:
            with self._conn:
                cursor = self._conn.execute(
                    "INSERT OR IGNORE INTO consumed_signatures "
                    "(sig_hash, minted_at, expired_at) VALUES (?, ?, ?)",
                    (sig_hash, now, expired_at),
                )
                return cursor.rowcount == 1

By relying on database-level primary key constraints via INSERT OR IGNORE, the storage engine handles the race condition directly. If two replicas receive the same signature simultaneously, exactly one insert succeeds and returns a row count of one. The second insert is ignored and returns a row count of zero, triggering the replay rejection.

A companion table tracks consumed token identifiers at the resource server using the same atomic claim semantics. An explicit housekeeping method purges records once their expiration window closes, preventing unbounded table growth while preserving safety across clock skews.

Setting clear expectations in authorization design

Engineering teams documenting an agent authorization architecture need to be explicit about where replay protection is enforced, distinguishing between credentials and underlying approvals. Stating that a system provides single-use tokens is ambiguous unless the design specifies whether that guarantee applies to credentials, approvals, or both.

The full architecture, which covers parameter-bound intent, destination gating, and isolated consent interfaces, is detailed in the core delegation guide. The complete Python reference implementation is available in the ActionAuth repository (action-auth).