# Why does an instance accept a federated agent warrant after its DID document rotation invalidates the mTLS binding? **Date of Record:** 2026 December 3 **Scope:** Applies to cross-organization agent federation where an inbound agent is authenticated by an mTLS client certificate whose SPKI thumbprint is published as a verification method inside a DID document, and where authorization is carried by a signed capability warrant referencing that DID. Does not apply to single-org deployments where the TLS terminator and the warrant issuer share a trust root, nor to bearer-token federation without DID-anchored key material. ## Core Distinction There are two distinct trust decisions in a DID + mTLS federation handshake, and most implementations collapse them into one: 1. **Transport identity binding** — "the holder of this TLS private key is the subject identified by the presented certificate." 2. **Warrant-to-key binding** — "the DID document, at the point of verification, still lists the key that signed this warrant, and that key is still authorized to act for the DID." The failure mode is not a broken signature and not a failed TLS handshake. It is a **temporal skew between two verifications that each pass independently**. The mTLS handshake validates the client cert against the CA chain at connection time. The warrant validates its signature against a DID document fetched (or cached) at a *different* time. When the DID document rotates — the agent's key is revoked and a new verification method is published — the cached document still vouches for the old key, and the warrant signed by the revoked key still verifies. The instance accepts a warrant that a fresh DID resolution would reject. The invariant that is violated: **the key that authenticated the channel and the key that authorized the action must be the same key, evaluated against the same DID document version, atomically.** Nothing in the protocol forces this atomicity. ## What Was Observed A federated auditor agent from Org B presented to Org A's task-orchestrator instance. The inbound request carried: - An mTLS client certificate issued by Org B's intermediate CA, with the agent's DID (`did:web:org-b.example:agents:auditor-7`) in the SAN URI field. - A signed capability warrant `W` asserting `can_verify(task_scope=T-4411)` with `exp` two hours out, signed by key `K_old`. - A DID document URL resolvable via `did:web`. Org A's verifier did the following, in order: ``` 1. TLS handshake: cert chain → Org B root (in Org A trust store) → OK. Extract SAN URI → did:web:org-b.example:agents:auditor-7 2. Resolve DID document (cache hit, age 41 min, TTL 3600s) → OK. 3. Find verification method matching warrant's `kid` → K_old present → OK. 4. Verify warrant signature with K_old → OK. 5. Verify SPKI thumbprint of client cert ∈ DID document verification methods → K_old thumbprint matches → OK. 6. Admit request. ``` Sixteen minutes before this request, Org B's security automation had executed a **key compromise rotation**: `K_old` was removed from the DID document, `K_new` published, and the `K_old` client certificate placed on the CA's revocation list. The rotation propagated to Org B's DID resolver and CRL distribution point. It did not propagate to Org A's 41-minute-old DID cache, and Org A's TLS stack was configured with `soft_fail` OCSP (a common default for cross-org latency reasons), so the revoked certificate still completed the handshake. The warrant was not forged. It was signed by `K_old` legitimately, before rotation, for a task that was still in scope. The auditor agent was a legitimate instance. But the *authority* under which it acted had been revoked, and Org A admitted it anyway because two verifications at two different times both returned `OK`. The observable signature of the failure, in Org A's audit log, was a request that passed every check while the DID document's `updated` timestamp was *later* than the warrant's `iat`. No component flagged this. The verifier never compared the two timestamps because they live in different subsystems: `updated` in the DID resolution layer, `iat` in the warrant layer. ## Condition of Validity The accept-after-rotation outcome is valid (i.e., the request is correctly admitted) only when **all** of the following hold simultaneously: - The DID document version used to verify the warrant is the version that was current at the warrant's `iat`, **and** no rotation has occurred between `iat` and now that revokes the signing key, **or** - The rotation is a *non-revoking* rotation (key added, none removed) — i.e., `K_old` remains in the document's verification methods, **and** - The client certificate's SPKI is not on any active revocation list at connection time, **and** - The warrant's `exp` has not passed and its `task_scope` is still live. If the DID document was rotated with revocation (`K_old` removed) at time `t_rot`, then any warrant with `iat < t_rot` signed by `K_old` is valid **only until `t_rot`**, regardless of `exp`. This is the "revocation truncates validity" rule. It is the invariant most implementations omit, because `exp` is the only expiry they model. A warrant's effective lifetime is `min(exp, t_rot_of_signing_key)`, and `t_rot_of_signing_key` is not knowable from the warrant alone — it requires resolving the DID document at verification time, not at issuance time. The condition fails silently when the DID cache TTL exceeds the rotation propagation SLA. If Org B commits to "rotations propagate within 5 minutes" and Org A caches for 60, then there is a 55-minute window in which revoked warrants verify. This window is not a bug in either org; it is a **contract mismatch** between a cache policy and a revocation SLA that neither side declared to the other. ## Decision Boundary The decision boundary is whether the verifier treats DID resolution as a **cached lookup** or as an **authorization input with freshness semantics tied to the warrant**. - **Cached-lookup framing (fails):** DID resolution is infrastructure. Cache aggressively for latency. The warrant is the authorization artifact; verify it against whatever key material is available. Under this framing, rotation is invisible until cache expiry, and the accept-after-rotation window is `cache_ttl - propagation_sla`. - **Authorization-input framing (holds):** The DID document version is part of the authorization decision. The warrant's `iat` and the document's `updated` must be reconciled. If `updated > iat` and the signing key is absent from the current document, reject — even if the cached copy still lists it. This forces a fresh resolution on any warrant whose `iat` precedes the cached document's `updated`, and treats the cached document as valid only for warrants issued *after* its `updated` timestamp. The precise boundary condition: **a warrant may be verified against a cached DID document if and only if `warrant.iat >= cached_doc.updated`.** If `warrant.iat < cached_doc.updated`, the warrant predates a rotation the cache knows about, and the verifier must either resolve fresh or reject. This single comparison closes the window without requiring real-time DID resolution on every request — the cache remains useful for the common case (warrants issued after the last rotation), and only the narrow band of pre-rotation warrants pays the resolution cost. A second boundary: the mTLS SPKI thumbprint check must be performed against the **same document version** used for the warrant signature check. If the verifier resolves the DID twice (once for signature, once for SPKI membership) and the cache refreshes between the two, the two checks can pass against different document versions — a TOCTOU variant unique to this stack, where the "time of check" is two separate resolutions rather than two separate syscalls. ## Operational Effect The downstream effect is that a revoked agent can continue to exercise delegated authority for the duration of the cache window, and every component in the path reports success. The orchestrator admits the request, the task proceeds, the auditor's verification is recorded as authoritative, and the audit trail shows a clean chain. The failure is only visible by correlating the DID document's `updated` timestamp against the warrant's `iat` — a correlation no single component performs under the cached-lookup framing. The architectural guardrail is a **freshness-coupled verifier** that: 1. Binds the DID document version (by `updated` timestamp or content hash) into the verification context at the start of the request and refuses to re-resolve mid-verification. 2. Enforces `warrant.iat >= doc.updated` for cached documents; on violation, forces a fresh resolution and re-runs all checks against the fresh version. 3. Treats the mTLS SPKI membership check as part of the same atomic verification context — same document version, same resolution. 4. Surfaces `t_rot_of_signing_key` as an explicit truncation of warrant validity, so that `effective_exp = min(warrant.exp, t_rot)` and any warrant past `t_rot` is rejected regardless of `exp`. 5. Fails closed on OCSP/CRL soft-fail for cross-org federation specifically, since the soft-fail path is what allows the revoked cert to complete the handshake in the first place. The cost is a fresh DID resolution for the narrow band of warrants issued before the last rotation — typically a small fraction of traffic, since most warrants are issued and consumed within minutes. The benefit is that the federation's trust anchor is a *versioned* anchor, not a cached one, and the window between rotation and rejection collapses from `cache_ttl` to the resolution latency. ```python import time from dataclasses import dataclass from typing import Optional class WarrantRotationSkewError(RuntimeError): """Raised when a warrant is verified against a DID document version that postdates the warrant's issuance, with the signing key revoked.""" @dataclass class DIDDocument: did: str updated: float # epoch seconds of last rotation verification_methods: dict # kid -> spki_thumbprint revoked_kids: set # kids removed by rotation @dataclass class Warrant: kid: str iat: float exp: float task_scope: str def verify_federated_warrant( warrant: Warrant, cached_doc: DIDDocument, client_cert_spki: str, resolver, # callable(did) -> DIDDocument now: Optional[float] = None, ) -> bool: now = now if now is not None else time.time() if warrant.exp < now: return False # Freshness-coupled check: a cached document may only vouch for # warrants issued at or after its last rotation. doc = cached_doc if warrant.iat < doc.updated: # Warrant predates a rotation the cache knows about; resolve fresh. doc = resolver(warrant.did if hasattr(warrant, "did") else cached_doc.did) # Revocation truncates validity: if the signing key was removed by a # rotation at t_rot, the warrant is dead from t_rot onward. if warrant.kid in doc.revoked_kids: raise WarrantRotationSkewError( f"warrant kid={warrant.kid} revoked by rotation at {doc.updated}; " f"warrant iat={warrant.iat} predates rotation — " f"effective_exp=min({warrant.exp},{doc.updated}) < now={now}" ) # Same-document-version binding: signature key and channel key must # both be present in the *same* resolved document. if warrant.kid not in doc.verification_methods: return False if doc.verification_methods[warrant.kid] != client_cert_spki: return False return True ```