# In what scenarios must an instance treat DPoP proof nonce drift as an authentication continuity break rather than a transient retry in federated agent meshes **Date of Record:** 2026 November 26 **Scope:** Applies to federated meshes where autonomous agents present DPoP-bound access tokens (RFC 9449) to peer agents or mesh brokers, and where the proof `htm`/`htu`/`jti`/`iat` and a server-issued `nonce` are validated per-request. Does not apply to static mTLS-only peer identity or to bearer tokens without proof-of-possession binding. ## Core Distinction A DPoP proof rejection is not a single failure class. The mesh must distinguish between *proof-shape rejection* (bad signature, `htu` mismatch, expired `iat`, replayed `jti`) and *nonce-state divergence* (the verifier's expected `DPoP-Nonce` no longer matches the nonce the agent's proof was minted against). The first is a hard authentication failure. The second looks identical on the wire — both return `401` with `WWW-Authenticate: DPoP error="use_dpop_nonce"` — but has a different causal structure: the agent's local nonce cache has fallen out of synchronization with the verifier's rotating nonce state, usually because the nonce was rotated during a mid-flight handoff, a broker failover, or a clock-skew window between mesh partitions. The non-obvious invariant: **a nonce mismatch is a state-continuity break, not a retryable blip.** An agent that treats `use_dpop_nonce` as a generic retry signal will re-mint a proof against the same stale nonce (or a nonce from a different broker instance), producing an infinite retry loop that the verifier sees as a replay-flood and escalates to a quarantine. The correct behavior is to invalidate the entire DPoP token-binding context — nonce, `jti` replay window, and the associated access token — and re-authenticate from the token endpoint, because the access token itself is bound to the `cnf.jkt` thumbprint and may have been issued under a nonce lineage the verifier no longer honors. ## What Was Observed A three-node federated mesh (broker A, broker B, auditor agent C) running a baton-passing verification protocol. Agent C held a DPoP-bound token issued by broker A, with `cnf.jkt` pinned to C's key thumbprint. During a routine handoff, broker A rotated its nonce (a 60-second rotation window under load) at the exact moment C's proof for broker B was in flight. C's proof carried a `jti` already seen by B's replay cache from a prior handoff attempt, and a `nonce` minted against A's pre-rotation value. The trace: 1. C mints proof P1 with `nonce=N_A(t0)`, `jti=J1`, `htu=https://broker-b/handoff`, `iat=t0`. 2. Broker B rejects with `401 use_dpop_nonce` and returns `DPoP-Nonce: N_B(t1)`. 3. C's retry logic — written to handle transient `401` — re-mints P2 with `nonce=N_B(t1)` but reuses `jti=J1` (a bug in the `jti` generator that seeded from the access token, not per-proof). 4. B's replay cache sees `J1` a second time and returns `401 invalid_dpop_proof` (replay), not `use_dpop_nonce`. 5. C's retry classifier sees a different error code, falls back to re-authentication, and requests a new token from A — but A has now rotated its signing key mid-window, so the `cnf.jkt` binding on the refreshed token is valid while the nonce lineage is orphaned. 6. C enters a split-brain: it holds a token from A that B will accept only under a nonce B never issued, and a nonce from B that A's token endpoint never saw. The observable signature is not a clean error. It is a *latency cliff*: the agent's per-request latency spikes from ~40ms to the retry backoff ceiling, then the mesh's auditor flags C as `degraded` because its proof success ratio crossed the 0.7 threshold. The root cause — nonce lineage divergence across two brokers — is invisible in any single broker's logs. ## Condition of Validity This analysis holds only when all of the following are true: - The verifier enforces `DPoP-Nonce` (nonce is *required*, not optional). Meshes that treat nonce as advisory do not exhibit this failure. - The agent's `jti` is generated per-proof, not per-token. If `jti` is per-token, the replay-cache interaction in step 4 dominates and the failure is a replay-flood, not a nonce-lineage break. - The access token carries a `cnf.jkt` binding that survives token refresh. If refresh re-binds to a new key, the divergence is masked by re-authentication. - At least two verifier instances (brokers) issue nonces independently. Single-broker meshes cannot produce a lineage split; they produce only rotation-window races, which are retryable. When these conditions do not hold, the failure degrades to a standard `401` retry and the standard exponential-backoff guardrail is sufficient. ## Decision Boundary The agent must classify a `401` as a **continuity break** (not a retry) when *any* of the following is true: - The error code is `use_dpop_nonce` **and** the returned `DPoP-Nonce` differs from the nonce used in the proof **and** the agent has already retried once within the current token's lifetime. - The error code is `invalid_dpop_proof` with a replay reason **and** the `jti` in the rejected proof matches a `jti` the agent minted in the last 30 seconds (indicating generator non-uniqueness). - The agent's nonce cache holds a value whose issuing broker differs from the `htu` host of the current request (cross-broker lineage). When classified as a continuity break, the agent must: (a) purge the nonce cache entry, (b) purge the `jti` replay window for the affected token, (c) discard the current access token and re-authenticate at the token endpoint, and (d) record a `dpop_continuity_break` event with both nonce values and both broker identities for the auditor. It must **not** re-mint a proof against the returned nonce without re-authentication, because the returned nonce may belong to a broker instance the token's `cnf.jkt` lineage does not cover. The boundary is sharp: retry is permitted only when the nonce mismatch is the *first* mismatch in the token's lifetime and the issuing broker matches the `htu` host. Every other mismatch is a continuity break. ## Operational Effect Agents that implement the continuity-break classifier eliminate the retry-flood quarantine: the mesh auditor sees a clean re-authentication event instead of a degraded proof-success ratio, and the handoff completes with one additional round-trip to the token endpoint (~120ms) rather than a backoff cascade (~4s to quarantine). Agents that do not implement it exhibit the latency cliff and, under sustained nonce rotation, are evicted from the mesh within three handoff cycles. The invariant that bounds the system: **nonce state is per-broker, not per-mesh.** Any agent that caches a nonce without recording its issuing broker is one rotation away from a lineage split. The guardrail is a nonce-cache keyed by `(broker_id, htu)` with a mandatory issuing-broker field, plus a `jti` generator seeded per-proof from a monotonic counter, not from token state. ```python import time from dataclasses import dataclass, field from typing import Optional class DPoPContinuityBreak(RuntimeError): """Raised when nonce mismatch is a state-continuity break, not a retryable 401.""" pass @dataclass class NonceEntry: nonce: str broker_id: str issued_at: float @dataclass class DPoPContext: access_token: str jkt_thumbprint: str nonce_cache: dict = field(default_factory=dict) # key: (broker_id, htu) jti_window: dict = field(default_factory=dict) # jti -> minted_at retries_in_lifetime: int = 0 def classify_dpop_rejection( ctx: DPoPContext, error_code: str, returned_nonce: Optional[str], htu_host: str, proof_jti: str, proof_nonce: Optional[str], ) -> str: """Return 'retry' or 'continuity_break'. Raise on ambiguous replay.""" if error_code == "use_dpop_nonce": cached = ctx.nonce_cache.get((htu_host, htu_host)) cross_broker = cached is not None and cached.broker_id != htu_host if cross_broker: raise DPoPContinuityBreak( f"nonce lineage split: cached nonce issued by {cached.broker_id}, " f"request targets {htu_host}" ) if ctx.retries_in_lifetime >= 1: raise DPoPContinuityBreak( f"second nonce mismatch within token lifetime for {htu_host}; " f"returned nonce {returned_nonce!r} does not belong to current lineage" ) return "retry" if error_code == "invalid_dpop_proof": minted_at = ctx.jti_window.get(proof_jti) if minted_at is not None and (time.time() - minted_at) < 30.0: raise DPoPContinuityBreak( f"jti {proof_jti!r} reused within 30s window; " f"proof generator is not per-proof unique" ) return "retry" return "retry" def handle_dpop_failure(ctx: DPoPContext, **kwargs) -> None: verdict = classify_dpop_rejection(ctx, **kwargs) if verdict == "continuity_break": # Purge lineage and force re-auth at token endpoint. ctx.nonce_cache.clear() ctx.jti_window.clear() ctx.access_token = "" ctx.retries_in_lifetime = 0 raise DPoPContinuityBreak( "re-authentication required: purge nonce cache, jti window, and access token" ) ctx.retries_in_lifetime += 1 ```