# Where must an instance refuse a DID-resolved agent passport when the issuer's key rotation window straddles the credential's proof timestamp **Date of Record:** 2026 November 25 **Scope:** Applies to federated agent-to-agent handshakes where an instance validates a peer's verifiable credential (VC) passport against a DID document resolved at handshake time. Does not apply to intra-org trust where issuer keys are pinned out-of-band, nor to long-lived session tokens already minted under a validated passport. ## Core Distinction The failure is not "expired credential" and not "revoked key." It is the **temporal ambiguity of a rotated verification method**: a DID document resolved at time `t_validate` advertises key `K2` as the current authentication method and lists `K1` (the key that actually signed the presented passport) either absent or in a `revoked`/`deactivated` state, *while the passport's `proof.created` timestamp `t_proof` predates the rotation*. The naive validator checks "does the signature verify against a key currently authorized in the resolved DID document?" — and the answer is **no**, so it rejects a credential that was perfectly valid at issuance. The opposite naive validator checks "does the signature verify against *any* key the DID doc ever contained?" — and accepts a credential signed with a key that was rotated *because it leaked*. Both are wrong. The correct decision is a three-way function over the ordering of `t_proof`, the rotation event, and `t_validate`, and it requires the DID document to carry **rotation provenance** (a `versionTime` / `updated` field and, ideally, an append-only log of key states), not just a current key set. ## What Was Observed A cross-org federation between a procurement agent (org A, instance `A-7`) and a supplier-quote agent (org B, instance `B-3`) failed intermittently at ~03:00 UTC, correlated with org B's scheduled key rotation job. Trace: 1. `B-3` presents a passport VC. `proof.created = 2025-06-08T22:14:03Z`, signed by verification method `did:web:orgb.example#key-1` (`K1`). 2. Org B's rotation runs at `2025-06-09T02:00:00Z`: `K1` is moved to `revoked`, `K2` (`#key-2`) becomes the `authentication` relationship. 3. `A-7` performs handshake at `2025-06-09T03:02:11Z`. It resolves `did:web:orgb.example` → current DID doc with only `K2` authorized. 4. Validator path 1: signature verifies against `K1` (correct), but `K1` is not in the current `authentication` set → **reject**. Handshake fails. Retry loop backs off, all retries inside the revoked window fail identically. 5. A second validator path (a fallback "lenient" mode enabled after the first incident) instead accepted *any* key in `verificationMethod` regardless of `revoked` status → this path silently accepted a passport signed by a key that had been revoked **for compromise** two rotations earlier, replayable by anyone holding the leaked `K1`. So the system had two failure modes gated by the same missing invariant: a **false rejection** of legitimately old-but-valid credentials, and a **false acceptance** of credentials signed under a key whose revocation reason was `keyCompromise`. Neither validator consulted `proof.created` against rotation `versionTime`. The deeper observation: `did:web` documents are mutable and served live, so the "trust anchor" is not a key — it is a *key-at-a-time*. A validator that treats the DID document as a static key set has thrown away the only piece of information that makes the rotation decision sound. ## Condition of Validity The invariant that must hold for a passport to be accepted is a conjunction over temporal ordering: - **Accept** iff `t_proof` lies within a key-state interval `[validFrom(K), validUntil(K))` for some key `K` such that the signature verifies under `K`, **and** the revocation reason for `K` (if any) is *not* `keyCompromise`/`superseded`-with-backdating, **and** the DID document resolution is itself authenticated (the doc's `updated`/`versionTime` is monotonic and the resolver did not fall back to a stale cache older than `t_proof`). - **Reject** iff no such interval exists, or `t_proof` is in the future relative to `t_validate` by more than clock skew tolerance `δ`, or the signing key's revocation reason is `keyCompromise`. - **Defer/deny-with-audit** iff the DID document lacks rotation provenance (`versionTime` absent, no key history), because then the ordering is unknowable and the validator cannot distinguish a benign rotation from a compromise. The critical, non-obvious clause: **`t_proof` must be checked against the key's validity interval, not against `t_validate`.** Clock skew `δ` must be applied to `t_proof` vs the key interval boundaries, and the skew budget must be strictly smaller than the shortest key-rotation interval, otherwise a clock-skewed peer can present a post-rotation passport as pre-rotation. ## Decision Boundary The boundary sits exactly at the **rotation event straddling `t_proof`**. Concretely, define: - `t_proof` — credential proof creation time (signed, therefore trustworthy modulo the signer's clock). - `[k_from, k_to)` — the signing key's authorized interval from the DID document's key history. - `t_validate` — local wall clock at handshake. The decision boundary is the predicate `k_from ≤ t_proof + δ < k_to` **AND** `revocation_reason(K) ∉ {keyCompromise}`. Everything hinges on whether the DID document you resolved *retains history* enabling this predicate. If the resolver returns only "current keys," the predicate is uncomputable and the only safe answer is deny-with-audit — never a silent accept, never a hard reject that a retry loop will hammer. A second boundary: the **staleness gate**. If `did_doc.updated > t_validate` (doc claims to be newer than our clock) or `did_doc.updated < t_proof - δ` (doc is older than the credential it must validate — impossible unless cached), the resolution is untrustworthy and must be re-resolved or denied. A cached DID doc that predates a compromise revocation is a replay vector. ## Operational Effect Without the invariant, federated handshakes exhibit a **scheduled, correlated outage** synchronized to every peer's rotation cron — not random, not load-related, so it evades load-based alerting and looks like "org B's agent is flaky at night." Meanwhile the lenient fallback path converts every rotation into a permanent replay window for the retired key. The operational consequence is that you cannot distinguish, from logs alone, a benign rotation rejection from a compromise-driven rejection, because both present as "signature key not in current authentication set." The fix is architectural, not a retry tweak: (1) require DID documents to expose key history with `versionTime` and revocation reasons; (2) validate `t_proof` against the key interval, not `t_validate`; (3) treat missing provenance as deny-with-audit, never accept; (4) forbid the lenient "any historical key" fallback — it is the compromise replay hole. The guardrail must live in the validator, because the peer cannot be trusted to self-report which key state it was in. ```python import time from dataclasses import dataclass, field from typing import Optional class PassportTrustAnchorError(RuntimeError): """Raised when DID-resolved passport validation hits an unresolvable temporal/rotation boundary and cannot safely accept or reject.""" pass @dataclass class KeyState: kid: str valid_from: float # epoch seconds valid_until: Optional[float] # None = still current revocation_reason: Optional[str] = None # e.g. "keyCompromise", "superseded" @dataclass class DidDocument: did: str updated: float # versionTime of this resolution keys: list[KeyState] = field(default_factory=list) @dataclass class Passport: subject_did: str signing_kid: str proof_created: float # t_proof signature_valid: bool CLOCK_SKEW = 120.0 # delta, seconds MIN_ROTATION_INTERVAL = 3600.0 # shortest allowed key lifetime def validate_passport( passport: Passport, doc: DidDocument, now: Optional[float] = None, ) -> bool: now = time.time() if now is None else now t_proof = passport.proof_created # Guard 1: resolution trust — doc must not be stale relative to the proof, # and must not claim to be newer than our own clock. if doc.updated < t_proof - CLOCK_SKEW: raise PassportTrustAnchorError( f"DID doc {doc.did} updated={doc.updated} predates proof " f"{t_proof}; stale resolution, possible replay." ) if doc.updated > now + CLOCK_SKEW: raise PassportTrustAnchorError( f"DID doc {doc.did} updated={doc.updated} is in the future " f"vs now={now}; untrustworthy resolution." ) # Guard 2: provenance must exist to compute the rotation boundary. if not doc.keys: raise PassportTrustAnchorError( f"DID doc {doc.did} carries no key history; rotation " f"boundary is uncomputable — deny-with-audit." ) # Guard 3: skew budget must be smaller than the shortest rotation interval, # else a skewed peer can dress a post-rotation proof as pre-rotation. intervals = [ (k.valid_until - k.valid_from) for k in doc.keys if k.valid_until is not None ] if intervals and CLOCK_SKEW >= min(intervals): raise PassportTrustAnchorError( f"CLOCK_SKEW={CLOCK_SKEW}s >= min rotation interval " f"{min(intervals)}s; skew can straddle the rotation boundary." ) if not passport.signature_valid: return False # Guard 4: the actual invariant — t_proof must fall inside the signing # key's authorized interval, and that key must not be compromise-revoked. for k in doc.keys: if k.kid != passport.signing_kid: continue if k.revocation_reason == "keyCompromise": raise PassportTrustAnchorError( f"Signing key {k.kid} revoked for keyCompromise; " f"passport must be rejected regardless of t_proof." ) lo = k.valid_from hi = k.valid_until if k.valid_until is not None else float("inf") if lo <= t_proof + CLOCK_SKEW < hi: return True return False # key known but proof outside its interval # Signing key not present in any state of the resolved doc. raise PassportTrustAnchorError( f"Signing kid {passport.signing_kid} absent from {doc.did} history; " f"cannot establish rotation boundary." ) ```