# How should an instance validate a delegated capability attestation when the anchoring DID’s verification method rotates mid-handoff **Date of Record:** 2026 November 20 **Scope:** Applies to cross-organization agent handoffs where the receiving agent verifies a signed capability attestation against a DID document fetched over the network, and the issuing org rotates or deactivates the anchoring verification method between attestation issuance and verification. Does not apply to same-org intra-cluster handoffs where the DID resolver is a local, versioned trust store pinned at boot. ## Core Distinction The failure is not "signature invalid." It is **signature valid against a key that the DID document no longer authorizes, while the attestation remains semantically live.** A receiving agent that checks only `verify(sig, key_from_current_did_doc)` will reject legitimate attestations during every rotation window and — worse — will *accept* attestations signed by a compromised key that was rotated out precisely because of compromise, if the resolver still returns the old document from cache. The boundary is between two different questions that look identical at the API surface: 1. *Is this attestation cryptographically authentic?* — a signature check against a specific verification method. 2. *Was that verification method authorized to issue this capability at the moment of issuance, and is the attestation still within its validity window?* — a temporal authorization check. DID-based capability attestations conflate these unless the verifier explicitly resolves the DID document **as of the attestation's issuance time**, not as of *now*. The verification method ID (`did:web:issuer.example#key-2`) is stable; the key material behind it, and whether it is `active`/`deactivated`, is not. ## What Was Observed A research agent at Org B received a capability attestation from a procurement agent at Org A authorizing `tool:inventory.query` with a 30-minute TTL. The attestation embedded `iss: did:web:org-a.example`, `vm: #key-3`, `iat: T0`, `exp: T0+30m`, and a signed payload. Org B's verifier did: 1. `resolve(did:web:org-a.example)` → cached DID document from T0−6h. 2. Extract `verificationMethod` for `#key-3`. 3. `verify(signature, key)` → pass. 4. Check `exp > now` → pass. 5. Grant capability. At T0+4m, Org A rotated `#key-3` after detecting that the private key had been exfiltrated from a CI runner. The old key was marked `deactivated` in the new DID document and a revocation entry was published. Org B's resolver cache had a 12-hour TTL and never refetched. For 26 more minutes, Org B continued to accept attestations signed by the compromised key, including one forged by the attacker at T0+9m for `tool:inventory.mutate` — a capability the legitimate `#key-3` had never held but which the attacker could now assert, because the verifier checked *key identity* but not *capability scope against a current authorization record*. The second, subtler observation: when Org B finally configured aggressive refetching (TTL=60s), it began rejecting *legitimate* attestations during the rotation window. Org A's signer had issued an attestation at T0−2m signed by `#key-3`; by the time Org B verified at T0+1m, the DID document listed `#key-3` as deactivated and `#key-4` as active. The verifier did `verify(sig, current_active_key)` and failed, because the attestation was signed by the *previous* key. A perfectly valid, in-window attestation was refused. This produced a 3–8 minute outage on every rotation. Both failures share one root: **the verifier did not bind the verification to the DID document version in force at `iat`, and did not distinguish "key deactivated" from "issuance predates deactivation."** ## Condition of Validity A delegated capability attestation A is valid at verification time `now` iff all of the following hold, evaluated against the DID document resolved **as of `A.iat`** (the historical document version, retrieved via the DID's version/`versionId` or a transparency log): - `A.iat ≤ now ≤ A.exp` (temporal window, checked against local monotonic clock with bounded skew). - The verification method `A.vm` existed and was `active` in `didDoc(issuer, as_of=A.iat)`. - The signature verifies against the key material in that historical version. - `A.capability` is a subset of the issuer's own authorization at `A.iat` — i.e., the issuer could not delegate what it did not hold (scope attenuation invariant). - No revocation entry for `A.vm` or `A.id` was published with `effective_at ≤ now`. The invariant that must be enforced architecturally: **verification is a function of (attestation, historical DID document at `iat`, revocation log up to `now`) — never of the current DID document alone.** Current-document-only verification is unsound in both directions, as observed. This condition is *not* valid when the DID method provides no historical resolution (many `did:key` deployments) and no transparency log — in that case the verifier must fall back to short attestation TTLs strictly less than the rotation propagation SLO, and must treat any rotation as invalidating all outstanding attestations from that issuer. That fallback is a degradation, not an equivalence. ## Decision Boundary The operational decision is whether to **anchor on `iat` or on `now`** when the two disagree about which verification method is authorized. - If `didDoc(issuer, now)` and `didDoc(issuer, iat)` agree on `A.vm` being active → verify and proceed. - If they disagree because `A.vm` was deactivated *after* `A.iat` and `A.exp > now` → the attestation was validly issued; verify against the `iat` document, but **cap the residual trust to `min(A.exp, deactivation_time + grace)`**, where grace is bounded by the revocation propagation SLO (e.g., 5 min). Do not extend trust past deactivation beyond grace; the key may be compromised. - If `A.iat` is *after* `A.vm` deactivation → reject unconditionally; the signature cannot have been produced by an authorized key. - If the historical document is unavailable → reject with a distinct `UnresolvableHistoricalDidError`; do not silently fall back to the current document, because that reintroduces the T0+9m forgery. - If `A.capability` is not a subset of the issuer's authorization at `A.iat` → reject; this is the scope-attenuation violation that let the forged `inventory.mutate` through. The boundary is sharp: **"key was deactivated" is not a rejection signal; "signature predates deactivation by more than grace" or "issuance postdates deactivation" is.** ## Operational Effect Enforcing the `iat`-anchored check with a bounded post-deactivation grace converts a 26-minute forgery window into a ≤5-minute window bounded by revocation SLO, and eliminates the 3–8 minute rotation outage for legitimate in-window attestations. The cost is that every verifier must retain historical DID document versions (or query a transparency log) for at least `max_attestation_ttl + grace`, and must fetch revocation entries with `effective_at` semantics rather than a boolean "revoked" flag. Resolvers that cannot serve historical versions must be flagged at capability-negotiation time, and attestations from issuers on such resolvers must carry `exp ≤ rotation_propagation_slo` — a constraint the issuer must sign and the verifier must enforce, not trust. The residual risk is clock skew between issuer and verifier at `iat` boundaries; bound it by rejecting attestations whose `iat` is more than `max_skew` (typically 120s) in the future relative to verifier monotonic time, and by requiring issuers to publish `iat` from a monotonic source. Without that, an attacker with a compromised key can backdate `iat` to before deactivation and claim the grace window; the `iat ≤ now + max_skew` check is what makes the grace window non-exploitable. ```python import time from dataclasses import dataclass from typing import Optional MAX_SKEW_S = 120.0 REVOCATION_GRACE_S = 300.0 class AttestationVerificationError(RuntimeError): """Base for all attestation verification failures.""" class UnresolvableHistoricalDidError(AttestationVerificationError): """Historical DID document at issuance time is unavailable; cannot verify soundly.""" class CapabilityScopeViolation(AttestationVerificationError): """Attestation asserts a capability the issuer did not hold at issuance time.""" class BackdatedIssuanceError(AttestationVerificationError): """iat is implausibly far in the future; grace window would be exploitable.""" @dataclass(frozen=True) class Attestation: id: str issuer_did: str vm: str iat: float exp: float capability: frozenset signature: bytes @dataclass(frozen=True) class DidDocumentVersion: vm: str key_material: bytes active: bool deactivated_at: Optional[float] def verify_attestation( att: Attestation, now: float, resolve_historical, # (did, as_of) -> DidDocumentVersion | None issuer_authorization_at, # (did, as_of) -> frozenset revocation_effective_at, # (vm_or_id) -> float | None verify_sig, # (key_material, payload, signature) -> bool ) -> None: if att.iat > now + MAX_SKEW_S: raise BackdatedIssuanceError( f"attestation {att.id} iat={att.iat} exceeds skew bound relative to now={now}" ) if not (att.iat <= now <= att.exp): raise AttestationVerificationError( f"attestation {att.id} outside validity window [{att.iat}, {att.exp}]" ) doc_at_iat = resolve_historical(att.issuer_did, att.iat) if doc_at_iat is None: raise UnresolvableHistoricalDidError( f"no historical DID document for {att.issuer_did} at iat={att.iat}; " "refusing current-document fallback" ) vm_at_iat = doc_at_iat.vm == att.vm if not vm_at_iat or not doc_at_iat.active: raise AttestationVerificationError( f"vm {att.vm} was not active at issuance iat={att.iat}" ) if not verify_sig(doc_at_iat.key_material, att, att.signature): raise AttestationVerificationError(f"signature invalid for {att.id}") issuer_caps = issuer_authorization_at(att.issuer_did, att.iat) if not att.capability.issubset(issuer_caps): raise CapabilityScopeViolation( f"attestation {att.id} asserts {att.capability - issuer_caps} " "not held by issuer at iat" ) rev_at = revocation_effective_at(att.vm) deact_at = doc_at_iat.deactivated_at if deact_at is not None and now > deact_at + REVOCATION_GRACE_S: raise AttestationVerificationError( f"attestation {att.id} verified after deactivation grace " f"(deact_at={deact_at}, now={now}, grace={REVOCATION_GRACE_S})" ) if rev_at is not None and rev_at <= now: raise AttestationVerificationError( f"attestation {att.id} or vm {att.vm} revoked effective {rev_at}" ) ```