# Where must an instance refuse a federated agent credential whose DID binding was valid at issuance but whose controller key rotated mid-handoff? **Date of Record:** 2026 November 24 **Scope:** Applies to cross-organization agent trust federation where an agent presents a Verifiable Credential (VC) whose subject is a Decentralized Identifier (DID), and the receiving instance resolves that DID to a controller key before executing a delegated task. Does not apply to intra-org service mesh mTLS, nor to credentials bound to a static X.509 subject where key rotation is out of band. ## Core Distinction There are two distinct notions of "valid credential" that federated agents routinely conflate: 1. **Issuance-time validity** — the VC's signature verifies against the issuer's DID document as it existed when `issuanceDate` was stamped, and the subject DID resolved to a controller key at that moment. 2. **Presentation-time binding** — the subject DID, resolved *now*, still maps to a controller key that the presenting agent can prove possession of (via a DIDAuth challenge or a key-bound proof in the credential). A credential can be perfectly valid under (1) and fatally broken under (2). The failure is not signature forgery and not expiry. It is a **binding discontinuity**: the DID document's `verificationMethod` set changed between issuance and presentation, so the key that signed the original proof-of-possession is no longer authoritative, yet the credential's cryptographic envelope still verifies. Receivers that check only (1) will accept an agent whose controller has rotated away — meaning the human/org that *currently* controls the DID has not authorized this execution. ## What Was Observed A delegated procurement agent (Org A) was issued a VC by a federation trust anchor granting scope `purchase:commit` up to a limit, subject DID `did:web:agent-a.procurement.example`. The credential embedded a `capabilityInvocation` proof signed by key `K1`, and the DID document at issuance listed `K1` under `verificationMethod` with `controller = did:web:org-a.example`. Mid-handoff — between Org A's agent preparing an order and Org B's fulfillment agent receiving it — Org A rotated its signing key to `K2` following a routine HSM migration. The DID document was updated: `K1` moved to `verificationMethod` with `deactivated: true`, `K2` added as the active `capabilityInvocation` key. The VC itself was **not** reissued; it remained signed and unexpired. Org B's receiving instance performed these checks in order: - VC signature against issuer DID document → **pass** (issuer unchanged). - `expirationDate` and `credentialStatus` (revocation list) → **pass** (not revoked, not expired). - Subject DID resolution → **pass** (DID document retrieved, JSON-LD valid). - **Missing:** cross-check that the proof's `verificationMethod` id (`...#K1`) is still listed as *active* in the freshly resolved document. Result: Org B executed a `purchase:commit` against a credential whose proof key had been deactivated. The order was real; the authorization chain was severed. Detection came 40 minutes later when Org A's audit reconciliation flagged a commit signed by a deactivated key. The blast radius was bounded only because the purchase limit was low. The trace, precisely: ``` t0 issue(VC, proof=K1, subject=did:web:agent-a) → valid t1 rotate(DID doc: K1→deactivated, K2→active) → binding changes t2 present(VC) to Org B → envelope still verifies t3 resolve(subject DID) → returns K1(deactivated), K2 t4 verify(proof.verificationMethod == K1) → TRUE (K1 in doc, but deactivated) t5 accept → WRONG: K1 not authorized at t2 ``` The invariant that was violated: **a credential is only authoritative if the proof's `verificationMethod` is in the active `capabilityInvocation`/`authentication` set of the DID document resolved at presentation time, not merely present in the document.** ## Condition of Validity A federated credential is executable by a receiving instance only when all of the following hold *simultaneously at presentation time*: - The issuer's signature verifies against the issuer DID document resolved at presentation (issuers can rotate too — resolve fresh, do not cache beyond a short TTL). - The subject DID resolves successfully and its document's `versionId`/`updated` timestamp is **newer than or equal to** the credential's `issuanceDate` resolution — i.e., you are not validating against a stale cached document. - The `verificationMethod` referenced by the proof is present in the resolved document **and** is not marked `deactivated` **and** appears in the `capabilityInvocation` (or `authentication`) verification relationship required by the credential's `proofPurpose`. - The `controller` of that verification method matches the org asserted in the federation trust policy for the requested scope. - The credential's `credentialStatus` resolves and is not `revoked`. The non-obvious clause is the third: **presence is not authorization.** A deactivated key remains in the DID document precisely so old signatures can be *audited*, not so they can be *executed*. The document is append-mostly; deactivation is a tombstone, not a deletion. Any verifier that treats "the `verificationMethod` id exists in the document" as sufficient will accept tombstoned keys. A second, subtler condition: DID document caching. If Org B had cached `did:web:agent-a.procurement.example` from before `t1`, it would resolve `K1` as active and pass even a correct active-set check. The rotation window is therefore a **cache-coherence hazard**, not just a logic bug. The guardrail is a cache TTL bounded below the federation's maximum rotation-propagation SLA, plus a `versionId` monotonicity check. ## Decision Boundary The receiving instance must make an explicit decision at the moment of presentation, and the boundary is sharp: - **Accept** only if the proof key is active *and* controller matches *and* status is good, all against a document resolved within the freshness window. - **Reject (hard)** if the proof key is present but `deactivated`, or absent from the required verification relationship. This is not a "warn and proceed" — a deactivated key means the authorization chain is severed. Fail closed. - **Defer/retry** if the DID document cannot be resolved fresh (network failure, cache stale beyond TTL). Do not fall back to a cached document to "keep the handoff moving." A handoff that cannot re-verify binding must **suspend**, not degrade. This is the boundary most systems get wrong: they treat resolution failure as a transient and reuse the last-known-good document, silently re-importing the rotation hazard. - **Re-request** if the credential's proof key is deactivated but the agent still holds a valid delegation: the correct remediation is a **credential refresh** signed by `K2`, not acceptance of the `K1` envelope. The boundary is *not* "is the signature valid." It is "does the currently-authoritative controller stand behind this specific execution." Those diverge exactly during rotation, and rotation is routine, not adversarial. ## Operational Effect The practical consequence is that **credential lifetime and key lifetime must be decoupled in the verifier's logic, and coupled in the issuer's policy.** Issuers that rotate keys faster than credentials expire will, by construction, produce credentials whose proof keys go stale mid-flight. Two mitigations, both necessary: 1. **Verifier-side active-set enforcement with fresh resolution.** Every presentation triggers a binding re-check against a document resolved within TTL. Deactivated keys fail closed. Resolution failure suspends the handoff. 2. **Issuer-side rotation-triggered reissuance.** When a `capabilityInvocation` key is rotated, outstanding VCs bound to the old key are either reissued under the new key or explicitly revoked via `credentialStatus`. Silent rotation without reissuance is the root cause; it converts a routine security operation into a distributed authorization gap. The audit consequence: any commit executed under a deactivated key is **unauthenticated at execution time** even though it is cryptographically intact. Reconciliation must treat such commits as suspect and route them to human review, because the verifier cannot prove the current controller authorized them — only that a former controller did. The invariant to encode: *binding is a present-tense property; signatures are past-tense facts.* A verifier that only checks the past will authorize the wrong present. ```python from dataclasses import dataclass from datetime import datetime, timedelta from typing import Optional class BindingDiscontinuityError(RuntimeError): """Raised when a credential's proof key is no longer authoritative at presentation time.""" pass class StaleResolutionError(RuntimeError): """Raised when the DID document cannot be resolved within the freshness window.""" pass @dataclass class VerificationMethod: id: str controller: str deactivated: bool relationships: set[str] # e.g. {"capabilityInvocation", "authentication"} @dataclass class DIDDocument: did: str version_id: int updated: datetime methods: dict[str, VerificationMethod] @dataclass class Credential: subject_did: str issuer_did: str proof_method_id: str # e.g. "did:web:agent-a#K1" proof_purpose: str # e.g. "capabilityInvocation" issuance_date: datetime expiration_date: datetime revoked: bool scope: str FRESHNESS_WINDOW = timedelta(seconds=30) def verify_federated_credential( cred: Credential, resolved_subject_doc: Optional[DIDDocument], resolved_at: datetime, now: datetime, expected_controller: str, ) -> None: # 1. Temporal envelope if cred.revoked: raise BindingDiscontinuityError(f"credential {cred.scope} revoked") if not (cred.issuance_date <= now <= cred.expiration_date): raise BindingDiscontinuityError("credential outside validity window") # 2. Fresh resolution — never fall back to cache to keep a handoff moving if resolved_subject_doc is None: raise StaleResolutionError( f"cannot resolve {cred.subject_did}; suspend handoff, do not reuse cache" ) if now - resolved_at > FRESHNESS_WINDOW: raise StaleResolutionError( f"DID doc for {cred.subject_did} resolved {now - resolved_at} ago; " f"exceeds {FRESHNESS_WINDOW}; re-resolve before authorizing" ) # 3. Binding must be present-tense: key active AND in the required relationship method = resolved_subject_doc.methods.get(cred.proof_method_id) if method is None: raise BindingDiscontinuityError( f"proof method {cred.proof_method_id} absent from current DID document" ) if method.deactivated: # The exact failure: envelope verifies, but key is a tombstone. raise BindingDiscontinuityError( f"proof method {cred.proof_method_id} is deactivated at presentation; " f"controller rotated mid-handoff — require reissued credential under active key" ) if cred.proof_purpose not in method.relationships: raise BindingDiscontinuityError( f"proof method {cred.proof_method_id} lacks relationship " f"'{cred.proof_purpose}' (has {method.relationships})" ) # 4. Controller must match the federation trust policy for this scope if method.controller != expected_controller: raise BindingDiscontinuityError( f"controller {method.controller} != expected {expected_controller} " f"for scope {cred.scope}" ) # 5. Document must not predate issuance (guards against stale-doc replay) if resolved_subject_doc.updated < cred.issuance_date: raise StaleResolutionError( "resolved DID document predates credential issuance; re-resolve" ) def handle_handoff(cred: Credential, doc: Optional[DIDDocument], resolved_at: datetime, now: datetime, expected_controller: str) -> str: try: verify_federated_credential(cred, doc, resolved_at, now, expected_controller) except StaleResolutionError as e: return f"SUSPEND: {e}" # do not degrade to cached authorization except BindingDiscontinuityError as e: return f"REJECT: {e}" return "ACCEPT" ```