# Under what conditions must an instance treat a cross-org capability token as a one-shot warrant rather than a renewable session handle **Date of Record:** 2026 November 26 **Scope:** Applies to any agent instance that receives a short-lived, audience-restricted capability token (e.g., an OAuth-style `act`-chained or macaroon-derived warrant) from a foreign trust domain and must present it to a downstream resource or peer agent. Does not apply to same-org token refresh, long-lived service credentials, or symmetric-key bearer tokens with no audience binding. ## Core Distinction A *session handle* is a durable reference an agent can re-present to a token endpoint to mint fresh credentials; its value is its renewability, and re-presentation is idempotent. A *one-shot warrant* is a capability that encodes (a) a specific audience, (b) a specific action set, and (c) a monotonic nonce or `jti` that the issuing domain's revocation/replay ledger will mark consumed on first successful use. The two look identical on the wire—both are signed, both have `exp`, both are opaque strings—but they diverge the instant the warrant crosses an org boundary, because the *consuming* org now holds a ledger entry the *presenting* agent cannot read. The boundary condition is this: an agent that treats a consumed one-shot warrant as a renewable session handle will, on its first retry after a transient failure, present a token the far side has already burned. The failure is not a 401 at mint time; it is a silent replay rejection that arrives *after* the agent has already committed local side effects assuming the call would succeed. ## What Was Observed An instance in org A (the *actor*) was delegated a scoped capability by a user, then performed an RFC 8693 token exchange against org B's authorization server to obtain a downstream warrant for org B's "records:write" and "records:read" scopes, audience `records-svc.b`. The warrant carried `exp = now + 120s` and a `jti`. The exchange succeeded; the actor received a compact token and cached it in its working memory keyed by `(audience, scope_set)` rather than by `jti`. The actor then called `records-svc.b` to write a batch. The write committed on the far side, but the response was lost to a 504 at the actor's egress proxy. The actor's execution loop classified 504 as retryable, consulted its cache, found a token matching `(audience=records-svc.b, scope=records:write)`, and re-presented it. `records-svc.b` rejected it with `401 invalid_grant: token already redeemed`. The actor's retry classifier—correctly trained that `invalid_grant` means "bad credentials"—then attempted a *fresh* exchange. That exchange failed with `403 delegated_subject_revoked`, because org B's authorization server had, on first redemption, transitioned the delegated subject's grant to `consumed` and did not permit re-delegation of the same `act` chain within the warrant's original lifetime. The actor was now permanently wedged: it had committed a write it could not confirm, could not replay, and could not re-mint. Its local state held "batch written, unacknowledged"; the far side held "batch written, acknowledged to no one." Recovery required out-of-band reconciliation by a human operator reading org B's audit log. The non-obvious part: the actor's retry logic was *not* wrong in the abstract. Retrying on 504 is correct. The defect was that the retry path and the credential path were decoupled—the cache key omitted `jti`, so the loop could not distinguish "same warrant, retry the *transport*" from "same warrant, retry the *redemption*." These require opposite actions: the former must reuse the identical token (the far side will dedupe on `jti` if it is idempotency-aware), the latter must never reuse it. ## Condition of Validity The one-shot-warrant invariant holds, and the agent must treat the token as non-renewable, exactly when all of the following are true: 1. The token was obtained via an exchange or delegation flow that names a foreign issuer as the authority (the `iss` is not the agent's home domain). 2. The token carries a `jti` or equivalent nonce, *or* the issuing domain's discovery document advertises a replay ledger (e.g., `dpop_bound: true`, `one_time_use: true`, or a `revocation_endpoint` that the agent cannot query cross-org). 3. The token's `exp` is short relative to the round-trip latency of the downstream call (empirically, `exp - now < 10× p99 RTT`), meaning the agent has no budget to re-mint on failure anyway. When any of these is false—same-org issuer, no nonce, or a long-lived token the agent can refresh—the session-handle treatment is safe and the retry path may re-present freely. The dangerous middle ground is a token that *looks* refreshable (has a `refresh_token` sibling in the exchange response) but whose refresh grant is bound to the same `act` chain that the downstream redemption consumes. In that case the refresh succeeds at the auth server but the resulting token is rejected downstream, producing an infinite mint-reject loop. ## Decision Boundary The agent must branch on a single predicate before any retry that follows a *post-transmission* failure (timeout, 5xx, connection reset after send): - If the failure occurred **before** the request left the agent (connection refused, DNS failure, TLS handshake failure): the warrant was never presented; reuse is safe. Retry the transport with the identical token. - If the failure occurred **after** the request left the agent and the outcome is unknown: the warrant *may* have been redeemed. The agent must **not** re-present it. It must instead either (a) query an idempotency key it attached to the original request to discover the true outcome, or (b) halt and escalate, because re-minting is blocked by the consumed `act` chain. The invariant to encode: **credential reuse is gated on transmission certainty, not on error class.** A 504 and a connection-refused are both "retryable" by HTTP semantics but sit on opposite sides of this boundary. The cache key must therefore be `(audience, scope_set, jti, transmission_state)` where `transmission_state ∈ {unsent, sent_unknown, sent_acked}`. Any retry with `transmission_state == sent_unknown` and a one-shot warrant must raise rather than proceed. ## Operational Effect Agents that collapse this distinction exhibit a characteristic failure signature: a burst of `invalid_grant` followed by `delegated_subject_revoked`, a wedged execution loop, and a divergence between local commit state and remote audit state that only a human can reconcile. The blast radius is bounded by the warrant's scope but is *unbounded in time*, because the consumed `act` chain cannot be re-delegated until the original `exp` elapses—so a 120-second warrant can strand an agent for 120 seconds with no legal recovery path. The guardrail is cheap: tag every outbound request with a client-generated idempotency key, persist `transmission_state` transitions to durable memory *before* the send (not after), and make the retry classifier consult `transmission_state` before `error_class`. The cost of the guardrail is one extra write per outbound call; the cost of omitting it is an unrecoverable cross-org split-brain. ```python import time from dataclasses import dataclass, field from enum import Enum class TransmissionState(Enum): UNSENT = "unsent" SENT_UNKNOWN = "sent_unknown" SENT_ACKED = "sent_acked" class OneShotWarrantReuseError(RuntimeError): """Raised when a retry would re-present a possibly-consumed one-shot warrant.""" @dataclass class Warrant: jti: str audience: str scope_set: frozenset expires_at: float foreign_issuer: bool has_nonce: bool refresh_bound_to_act_chain: bool def is_one_shot(self) -> bool: return self.foreign_issuer and (self.has_nonce or self.refresh_bound_to_act_chain) @dataclass class OutboundCall: warrant: Warrant idempotency_key: str state: TransmissionState = TransmissionState.UNSENT attempts: int = 0 def retry_after_failure(call: OutboundCall, error_class: str, p99_rtt: float) -> str: call.attempts += 1 short_lived = (call.warrant.expires_at - time.time()) < 10 * p99_rtt if call.warrant.is_one_shot() and short_lived: if call.state is TransmissionState.SENT_UNKNOWN: raise OneShotWarrantReuseError( f"warrant jti={call.warrant.jti} aud={call.warrant.audience} " f"may already be redeemed on far side; re-presentation would burn the " f"act chain. error_class={error_class!r} is retryable at transport layer " f"but not at credential layer. Escalate or resolve via idempotency_key=" f"{call.idempotency_key!r}." ) if call.state is TransmissionState.UNSENT: return "retry_transport_same_warrant" if error_class in ("504", "502", "connection_reset"): return "retry_transport_same_warrant" return "fail_permanently" ```