# Why does an instance accept a federated Agent Card whose DID controller has rotated out from under the credential's issuance window? **Date of Record:** 2026 December 1 **Scope:** Applies to cross-organization agent federation where an inbound peer's Agent Card is attested by a Verifiable Credential (VC) whose `issuer` is a DID, and where the receiving agent validates the card by resolving the issuer DID document and checking controller/key material at verification time. Does not cover intra-org trust where the verifier and issuer share a root of trust by construction. ## Core Distinction The failure is not signature forgery. Every cryptographic check passes. The failure is a **temporal binding gap** between the moment a credential was signed and the moment its issuer's DID document is resolved for verification. A DID is a mutable pointer: its document can add/remove `controller` entries, rotate `verificationMethod` keys, and update `alsoKnownAs` at any time, and those mutations are not covered by the credential's signature. A VC asserts "issuer D signed these claims at time T." It does *not* assert "D's controller set at time T is the same controller set you will resolve at time T+Δ." When the receiving agent resolves the DID at verification time rather than at issuance time, it is validating the credential against a *current* controller graph that the original signer never authorized. The invariant that is silently violated: **the authority under which a credential was issued must be evaluated against the DID document state that was effective at issuance, not the state at verification.** Federation stacks that resolve-then-verify collapse these two instants into one and thereby inherit whatever controller changes happened in between. ## What Was Observed A federated peer org (call it Org-B) published an Agent Card at `did:web:agents.org-b.example`. The card's `capabilities` and `endpoints` fields were attested by a VC issued by `did:web:org-b.example` with `issuanceDate: 2025-04-02T00:00:00Z` and no `expirationDate`. Org-B's DID document at issuance listed `did:web:org-b.example#key-1` as the sole `verificationMethod` and `did:web:org-b.example` itself as the sole `controller`. On 2025-05-11 Org-B executed a routine key rotation for the *root* DID (`did:web:org-b.example`), demoting `#key-1` to `#key-1-retired` and promoting `#key-2`. The Agent Card VC was reissued and re-signed correctly — but the *old* VC remained valid and cacheable because it carried no expiration and the peer's card-serving endpoint kept serving the older signed blob to caches that had not yet revalidated. The root DID document, meanwhile, no longer contained `#key-1` as an active verification method. The receiving agent (Org-A) had a 24-hour Agent Card cache keyed by DID. At 09:14 on 2025-05-12 it served a cached card whose VC referenced `#key-1`. On the next full revalidation at 09:14 on 2025-05-13, it re-resolved `did:web:org-b.example`, found no `#key-1`, and **rejected the card as unverifiable** — even though the card was internally consistent and had been validly issued against the DID document that existed on 2025-04-02. The peer was de-federated for 6 hours until an operator manually pinned the retired key. The inverse case was worse. A different peer, Org-C, rotated its root DID controller on 2025-05-20 to add a new `controller` entry (`did:web:ops.org-c.example`) during an acquisition. An *old* Agent Card VC from 2025-03-01, still served by a stale CDN edge, was re-verified by Org-A against the *new* DID document. The signature verified because `#key-1` was retained; but the credential was now being validated under a controller set that did not exist at issuance and that the original signer never consented to. Org-A accepted an endpoint binding that the March controller graph had not authorized. This is the trust-anchor substitution: the *set of parties who can speak for the DID* changed, and the verifier silently adopted the new set for an old credential. ## Condition of Validity The gap only manifests when **all** of the following hold, which is why it is easy to miss in testing: 1. The issuer DID is **mutable** (any `did:web`, `did:key` excluded because it is self-certifying and immutable, `did:pkh` similarly bounded). Self-certifying DIDs cannot exhibit this failure; the controller set is a function of the identifier. 2. The VC carries **no `expirationDate`** or an expiration longer than the typical rotation cadence, so it survives at least one DID document mutation. 3. The verifier resolves the DID document **at verification time** and does not consult a historical/log-anchored resolution. 4. The DID method's document history is **not consulted** — i.e., the verifier does not fetch the version of the document effective at `issuanceDate` (via a DID resolution `versionTime` parameter or an external transparency log such as a DID registry with append-only semantics). Remove any one condition and the failure is bounded. The operational consequence: a federation that passes conformance tests on freshly-issued credentials will fail in production precisely at the intersection of rotation cadence and cache TTL, which is the one interval that test suites never exercise. ## Decision Boundary The verifier must choose, per credential, between two evaluation policies, and must make the choice explicit and logged: - **Issuance-time binding (strict):** Resolve the issuer DID at `versionTime = issuanceDate` (or verify against a signed document snapshot embedded in the VC's `credentialStatus`/proof). Accept only if the signing `verificationMethod` was present and authorized in *that* document version. Reject if the DID method cannot provide historical resolution — do not silently fall back to current state. - **Current-state binding (lenient):** Resolve at verification time and accept. This is only sound when the credential is short-lived relative to the DID's rotation policy, or when the issuer's DID method is self-certifying. The boundary is crossed the moment a verifier applies lenient resolution to a long-lived credential from a mutable DID. The guardrail is a **rotation-window invariant**: for any credential with `expirationDate = E` and issuance `I`, the verifier must require `E - I ≤ R` where `R` is the issuer's declared maximum rotation interval, published in the DID document's `service` section (e.g., `#rotation-policy` with a `maxInterval`). If the credential's lifetime exceeds `R`, the verifier MUST use issuance-time resolution. A credential with no `expirationDate` from a mutable DID is treated as having `E = ∞` and therefore *always* requires issuance-time resolution. ## Operational Effect Without the invariant, two symmetric failure modes propagate through the federation: 1. **Spurious de-federation on rotation.** Cached cards referencing retired-but-validly-issued keys fail revalidation, taking healthy peers offline for the duration of the cache TTL mismatch. This is a availability failure that looks like a security event and burns operator time on false positives. 2. **Silent trust-anchor substitution.** Stale credentials re-verified against mutated controller graphs cause the verifier to accept endorsements from controllers who were not authoritative at issuance — the acquisition/insider case above. This is the security-relevant failure and it produces *no* error; the card is accepted, the endpoint is bound, and the audit log records a successful verification. The operational fix is not "rotate less" or "expire faster." It is to make the DID document's history a first-class input to verification: either via `versionTime` resolution, via a transparency-log-anchored document, or via an explicit rotation-policy service endpoint that lets the verifier compute the issuance-time authority set. The receiving agent's audit record must capture both the resolved document version and the version it *should* have used, so that a post-hoc replay can distinguish "verified under current authority" from "verified under issuance-time authority." ```python import hashlib from dataclasses import dataclass from datetime import datetime, timedelta from typing import Optional class TrustAnchorRotationError(RuntimeError): """Raised when a credential's authority cannot be bound to a single DID document version.""" @dataclass(frozen=True) class VerifiableCredential: issuer_did: str issuance: datetime expiration: Optional[datetime] # None == unbounded signing_key_id: str claims_hash: str @dataclass(frozen=True) class DidDocumentVersion: did: str effective_at: datetime verification_methods: frozenset[str] controllers: frozenset[str] @dataclass(frozen=True) class RotationPolicy: max_interval: timedelta def _resolve_at(did: str, when: datetime, history: list[DidDocumentVersion]) -> DidDocumentVersion: candidates = [d for d in history if d.did == did and d.effective_at <= when] if not candidates: raise TrustAnchorRotationError( f"no DID document version for {did} effective at or before {when.isoformat()}" ) return max(candidates, key=lambda d: d.effective_at) def verify_federated_card( vc: VerifiableCredential, history: list[DidDocumentVersion], policy: RotationPolicy, now: datetime, ) -> DidDocumentVersion: """Bind the credential to exactly one DID document version. Returns the document version under which the credential is authoritative. Raises TrustAnchorRotationError if the binding is ambiguous or violated. """ if vc.expiration is not None and vc.expiration <= now: raise TrustAnchorRotationError( f"credential from {vc.issuer_did} expired at {vc.expiration.isoformat()}" ) lifetime = (vc.expiration - vc.issuance) if vc.expiration else None unbounded = lifetime is None exceeds_rotation_window = unbounded or lifetime > policy.max_interval if exceeds_rotation_window: # Strict policy: must bind to issuance-time document, not current state. doc = _resolve_at(vc.issuer_did, vc.issuance, history) if vc.signing_key_id not in doc.verification_methods: raise TrustAnchorRotationError( f"signing key {vc.signing_key_id} was not authoritative for " f"{vc.issuer_did} at issuance {vc.issuance.isoformat()}" ) if doc.controllers != _resolve_at(vc.issuer_did, vc.issuance, history).controllers: # Defensive: controller set must be singular at issuance. raise TrustAnchorRotationError( f"ambiguous controller set for {vc.issuer_did} at issuance" ) return doc # Lenient policy: credential lifetime is bounded within the rotation window, # so current-state resolution is sound. current = _resolve_at(vc.issuer_did, now, history) if vc.signing_key_id not in current.verification_methods: raise TrustAnchorRotationError( f"signing key {vc.signing_key_id} not present in current document for " f"{vc.issuer_did}; rotation occurred inside credential lifetime" ) return current def audit_binding(vc: VerifiableCredential, history: list[DidDocumentVersion], policy: RotationPolicy, now: datetime) -> str: """Record both the version used and the version that strict policy would have required.""" used = verify_federated_card(vc, history, policy, now) strict = _resolve_at(vc.issuer_did, vc.issuance, history) digest = hashlib.sha256( f"{used.effective_at.isoformat()}|{strict.effective_at.isoformat()}|{vc.claims_hash}".encode() ).hexdigest() if used.effective_at != strict.effective_at: return f"LENIENT_BINDING used={used.effective_at.isoformat()} strict={strict.effective_at.isoformat()} digest={digest}" return f"STRICT_BINDING at={used.effective_at.isoformat()} digest={digest}" ```