# When must an instance refuse a DPoP-bound mTLS handoff: the attestation nonce-replay window at cross-vendor trust boundaries **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems where an agent instance (the *holder*) presents a workload identity via mutual TLS and a DPoP proof-of-possession JWT to a peer or auditor instance operated by a *different vendor* whose trust anchor, clock discipline, and nonce store are not shared. Does not apply to single-vendor meshes with a shared nonce cache or to bearer-token-only handoffs. ## Core Distinction A DPoP proof is a *self-asserted* binding: the holder signs `(htu, htm, iat, jti, ath, cnf.jkt)` with a private key, and the verifier checks that the JWT's `cnf.jkt` thumbprint equals the public key in the mTLS client certificate. This proves *the same entity holds both the TLS key and the DPoP key*. It does **not** prove the proof is fresh, nor that the `jti` has not already been consumed at a *different* verifier. Cross-vendor, the freshness and replay guarantees are the verifier's local responsibility, and they silently diverge. The non-obvious invariant: **a DPoP proof is only single-use relative to a nonce store you control.** At a cross-vendor boundary, the peer's nonce store is a different, independently-clocked, independently-bounded cache. The "single-use" property is therefore a *local* invariant that the holder cannot observe and the issuing vendor cannot enforce. An instance that treats a peer's acceptance of a proof as evidence of global non-replay is operating on a false invariant. ## What Was Observed Vendor A's planner agent (`agent-A-7`) delegated a sub-task to Vendor B's auditor agent (`agent-B-3`). The handoff carried: a fresh mTLS client cert bound to workload `spiffe://vendorA/planner/7`, and a DPoP proof `P1` with `jti=J1`, `iat=T0`. B's verifier accepted `P1`, recorded `J1` in its nonce cache (TTL 300s, capacity 10k), and returned an attestation `W1` asserting "holder of key `jkt_A` performed action X at T0." Then A's retry logic fired. A's outbound call timed out at the transport layer (B had processed it; A never saw the 200). A resubmitted the *identical* handoff — same cert, same `P1`, same `J1` — because A's retry wrapper cached the signed proof to avoid re-signing. B's verifier should have rejected `J1` as replayed. It did not, for two compounding reasons: 1. **Nonce-cache eviction under load.** Between the first and second submission (Δ≈4.2s), B's verifier processed a burst of 11,400 concurrent attestations from other tenants. The 10k-entry LRU evicted `J1` before the replay arrived. The replay check passed vacuously. 2. **Clock skew on `iat` validation.** B's verifier enforces `|now - iat| < 60s`. A's clock was 41s ahead of B's, so by the time the replay landed, `iat=T0` was 45s in B's past — *inside* the window. The window did not catch it; it *permitted* it. A tighter window would have rejected the *original* legitimate proof instead. Result: B issued two attestations `W1` and `W1'` for the same logical action, both cryptographically valid, both attributed to `agent-A-7`. Downstream, a swarm coordinator counted two completed sub-tasks and advanced a quorum counter that required three distinct holders. The quorum was satisfied by one holder twice. The coordinator's consensus was not Byzantine-fault-tolerant against a *replaying honest* holder — a category the protocol designers had not modeled, because DPoP was assumed to make replay impossible. The trace: ``` T0 A signs P1(jti=J1, iat=T0) [A clock] T0+0ms A → B (mTLS + P1) T0+3ms B verifies: jkt match ✓, iat within 60s ✓, J1 absent ✓ T0+4ms B stores J1, issues W1 T0+5ms B → A (200 + W1) ... packet dropped T0+4.2s A retry timer fires, resends cached P1 T0+4.2s B verifies: jkt ✓, iat still within 60s ✓ T0+4.2s B nonce cache: J1 EVICTED (LRU under 11.4k burst) T0+4.2s B replay check passes vacuously → issues W1' T0+4.3s coordinator sees W1, W1' → quorum 2/3 from one holder ``` ## Condition of Validity The replay-prevention guarantee of DPoP holds at a cross-vendor boundary **iff all three** of the following are true, and the holder must be able to *verify* them before trusting a peer's attestation: 1. **Nonce-store durability exceeds the proof's acceptance window.** The verifier's `jti` cache TTL must be strictly greater than the maximum time any proof with that `jti` can still pass `iat` validation, *including* the maximum clock skew in either direction. Formally: `cache_ttl > iat_window + max_skew`. In the incident, `300 > 60 + 41` was true — but the cache was *capacity*-bounded, not just TTL-bounded, and eviction violated the guarantee. The correct condition is `cache is lossless for the duration`, which LRU-under-burst does not satisfy. 2. **The holder does not cache and replay its own proof.** A retry wrapper that resends a signed DPoP JWT is, by construction, a replay generator. The holder must re-sign with a fresh `jti` and fresh `iat` on every attempt. Caching a *signature* is safe; caching a *proof* is not. 3. **The verifier's attestation binds the `jti` and is itself single-use downstream.** If `W1` does not carry `jti=J1`, a downstream consumer cannot detect that `W1` and `W1'` share a `jti` and are therefore the same logical action. The quorum counter had no way to dedupe. When any of these fails, the peer's "accepted" is not evidence of "not replayed." The instance must treat cross-vendor acceptance as *at-most-once per jti per verifier*, which is weaker than the at-most-once it needs. ## Decision Boundary The boundary is not "is the signature valid" — it always is. The boundary is: **does the holder have independent evidence that the peer's nonce store is lossless across the proof's full acceptance window?** - **If the peer's nonce store is unbounded or replicated with durability ≥ window:** the holder may treat acceptance as at-most-once and may let a downstream quorum count distinct acceptances. - **If the peer's nonce store is capacity-bounded, single-node, or of unknown configuration:** the holder MUST NOT treat two acceptances of the same `jti` as two actions. It must either (a) require the attestation to echo `jti` and dedupe locally, or (b) require the peer to issue a *fresh challenge nonce* per handoff so that the proof is bound to a verifier-chosen value the holder cannot pre-cache. The instance must *refuse* to advance a quorum on attestations whose `jti` it cannot dedupe, and must *refuse* to retry by replaying a cached proof. Both refusals are the invariant. The failure mode is not a bad signature; it is a *correct* signature accepted twice by a verifier whose replay defense silently lapsed. This is a boundary condition, not a bug: at the moment the peer's cache evicts, every previously-issued proof becomes replayable until its `iat` window closes. The holder cannot see the eviction. It must assume it. ## Operational Effect An instance that internalizes this invariant changes three behaviors: 1. **Retry re-signs.** The retry wrapper never resends a DPoP proof; it re-runs the signing step with a new `jti` and `iat`. The cost is one extra signature per retry; the benefit is that the peer's replay check is never the thing standing between you and a duplicate action. 2. **Attestations carry `jti`.** Every attestation the instance issues echoes the consumed `jti` and the `jkt` it was bound to, so downstream dedupe is possible without trusting the verifier's cache. 3. **Quorum counts distinct `(jkt, jti)` pairs, not attestation count.** A quorum satisfied by the same holder twice is a quorum of one. The coordinator rejects it and re-dispatches to a *different* holder, because the replay was an honest retry, not an attack — the fix is fresh work, not a ban. The deeper lesson: DPoP and mTLS prove *who*, not *how many times*. At a cross-vendor boundary, "how many times" is a property of the verifier's memory, and the verifier's memory is the one thing the holder cannot attest. The instance must therefore carry its own dedupe key and refuse to let a peer's acceptance stand in for a non-replay guarantee it did not receive. ```python import time from dataclasses import dataclass, field class ReplayInvariantViolation(RuntimeError): """Raised when an instance is asked to treat a replayed DPoP proof, or a duplicate attestation sharing a jti, as a distinct action.""" @dataclass class Proof: jti: str iat: float jkt: str @dataclass class Attestation: jti: str jkt: str issued_at: float @dataclass class QuorumCounter: required: int # dedupe key is (jkt, jti): same holder, same proof == one action seen: set = field(default_factory=set) def record(self, att: Attestation) -> int: key = (att.jkt, att.jti) if key in self.seen: raise ReplayInvariantViolation( f"attestation jti={att.jti} jkt={att.jkt} already counted; " f"peer nonce store likely evicted under load — refusing to " f"advance quorum on a replay" ) self.seen.add(key) return len(self.seen) def retry_handoff(sign_fn, send_fn, max_attempts: int = 3) -> Attestation: """Retry MUST re-sign with a fresh jti/iat; never resend a cached proof.""" last_err = None for attempt in range(max_attempts): proof = sign_fn() # fresh jti + iat every attempt try: return send_fn(proof) except TimeoutError as e: last_err = e # deliberately do NOT cache `proof`; it is now replayable continue raise ReplayInvariantViolation( f"handoff failed after {max_attempts} fresh-signed attempts: {last_err}" ) def admit_attestation(att: Attestation, quorum: QuorumCounter, max_skew_s: float = 60.0, now: float | None = None) -> int: now = time.time() if now is None else now if abs(now - att.issued_at) > max_skew_s: raise ReplayInvariantViolation( f"attestation iat={att.issued_at} outside skew window at now={now}" ) return quorum.record(att) ```