# In what scenarios must an instance refuse an AAIF verifiable credential whose issuer chain has silently re-rooted mid-session **Date of Record:** 2026 November 26 **Scope:** Applies to long-lived agent instances that cache a decentralized identifier (DID) document and a verifiable credential (VC) chain at task start and continue operating across issuer key-rotation or DID-document re-rooting events. Does not apply to single-shot, sub-second invocations that resolve and verify credentials atomically within one request. ## Core Distinction The failure is not "an expired credential." Expiry is a monotonic, locally-checkable predicate: `exp > now` is decidable from the credential alone, and every well-built verifier rejects it deterministically. The failure examined here is **silent re-rooting of the issuer's DID document** — the resolution of `did:example:issuer-A` returns a *different* verification method set than the one the agent pinned when it first accepted the credential, without any signal in the credential itself that its trust root moved. A VC is a signed claim of the form `(issuer, subject, claims, signature)`. Verification is a two-step chain: (1) resolve `issuer` to a DID document, (2) check the signature against a `verificationMethod` listed in that document. Step (1) is a *network fetch against mutable state*. Step (2) is *pure cryptography against immutable bytes*. The boundary condition lives in the gap: the signature is valid against the *current* document, and was valid against the *pinned* document, but the two documents authorize different key material. An agent that re-resolves lazily and trusts the result has silently accepted a credential under a trust root it never audited. ## What Was Observed A delegation chain was established at `t0`. Agent `orchestrator-7` received a VC from `did:web:acme.example:issuer` granting `scope: {tool: "payments.transfer", limit: 5000}`. At `t0` the issuer DID document listed a single verification method `#key-1` (Ed25519, multibase `z6Mk...`). The orchestrator pinned `(did, key-id, key-material, document-version-id)` in its session state and proceeded. At `t0 + 41m`, the issuer rotated keys: `#key-1` was retired, `#key-2` introduced, and — critically — the DID document's `alsoKnownAs`/controller graph was edited so the document was now self-controlled by a *different* controller DID that had itself been re-pointed. The DID document's `versionId` incremented. No revocation event fired: the original VC was never revoked, because the issuer considered the credential still valid — it had merely migrated its trust anchor. At `t0 + 43m`, `orchestrator-7` performed a second `payments.transfer` under the same cached VC. Its verification path re-resolved the issuer DID (a "defensive re-check" added to catch revocation), found `#key-2`, and — because the signature check was implemented as *"is the signature valid under any currently-listed verification method"* rather than *"is the signature valid under the pinned method"* — the check **failed closed on signature but open on trust**, and the surrounding code path treated the signature mismatch as a soft warning because the *credential* had not been revoked. The transfer executed. The trace, compressed: ``` t0 resolve(issuer) -> doc_v1 {#key-1}; pin(doc_v1); verify(VC, #key-1) -> OK t0+41m issuer re-roots: doc_v2 {#key-2}, controller -> did:other t0+43m re-resolve(issuer) -> doc_v2 verify(VC, #key-2) -> SIGNATURE_MISMATCH revocation_check(VC) -> NOT_REVOKED policy: "mismatch but not revoked" -> WARN, proceed <-- defect transfer(5000) -> EXECUTED ``` The credential was never invalid. The *authorization context* was invalid. The agent conflated "the credential is still live" with "the credential is still authorized by the principal I originally trusted." ## Condition of Validity The invariant an AAIF verifier must uphold is a **pin-and-compare**, not a **resolve-and-trust**: > A credential accepted at time `t0` under issuer DID document version `V` remains authorized at time `t1` **iff** the issuer's DID document at `t1` has the same `versionId` as `V`, *or* the transition `V -> V'` is accompanied by a signed continuity proof (a key-rotation record signed by a key valid under `V`) that the verifier validates before accepting `V'`. Absent that continuity proof, re-rooting is indistinguishable from **issuer impersonation via DID-document takeover**. The verifier cannot tell "the legitimate issuer rotated keys and updated its document" from "an attacker gained control of the DID document's hosting and substituted their own key." Both produce a `versionId` bump and a new `verificationMethod`. The only thing that distinguishes them is whether the old key signed the transition. This condition is *invalid* — the invariant does not hold — whenever any of the following is true: 1. The DID method is `did:web` or another method where document control is delegated to DNS/TLS/web hosting with no on-chain or ledger-anchored version history. Here `versionId` is advisory and can be rewritten arbitrarily by whoever controls the host. 2. The verification code path performs lazy re-resolution and treats a signature mismatch as non-fatal because revocation did not fire. 3. The pinned state records only the `did` string and not `(versionId, key-id, key-material-hash)`, so there is nothing to compare against. ## Decision Boundary The decision boundary is the **trust-anchor continuity check**, evaluated at every re-verification, not just at first acceptance: - **If `resolved.versionId == pinned.versionId`**: proceed. The trust root is unchanged; re-verify the signature against the pinned key. This is the common case and must be cheap. - **If `resolved.versionId != pinned.versionId`**: do **not** re-verify against the new document and proceed. First demand a continuity proof: a rotation record binding `pinned.key-material` to `resolved`'s new verification methods. Validate that record. Only on success update the pin. On failure, **halt the delegated action** and escalate — do not fall through to "not revoked, therefore proceed." - **If the DID method cannot supply a continuity proof** (e.g., `did:web` without a signed rotation log): treat any `versionId` change as a hard trust break for actions above the instance's own authority. The instance may continue only actions that require no delegated authority. The non-obvious part: **revocation status is orthogonal to trust-root continuity.** A credential can be simultaneously *not revoked* and *no longer authorized by the principal the agent trusted*. Conflating the two is the defect. The guardrail is a separate predicate — `trust_root_continuous(pinned, resolved)` — that must gate every use of a cached credential, independent of the revocation check. ## Operational Effect An instance that pins only the DID string and re-resolves lazily will, on issuer re-rooting, either (a) fail closed on signature mismatch and stall every in-flight delegated task until manual intervention, or (b) — worse — treat the mismatch as advisory and execute under a trust anchor it never audited. Case (b) is a silent privilege transfer: the delegated authority (`payments.transfer`, `limit: 5000`) continues to be exercised, but the principal that granted it is no longer the principal the agent is actually trusting. In a multi-agent swarm this propagates: downstream agents that received sub-delegations from `orchestrator-7` inherit the re-rooted trust without ever seeing the original pin, because the sub-credential's issuer is `orchestrator-7`, whose own document is intact — the break is one hop up the chain and invisible to the leaf verifier unless the entire chain's pins are carried in the handoff. The correct operational posture is to carry the **full pin set** (every issuer in the chain, with `versionId` and key-material hash) in the agent's session state and in any sub-delegation it issues, and to re-evaluate `trust_root_continuous` across the whole set at each use. The cost is one comparison per issuer per action; the alternative is an undetectable authority substitution. ```python import hashlib from dataclasses import dataclass class TrustRootDiscontinuity(RuntimeError): """Raised when an issuer DID document re-roots without a valid continuity proof.""" pass @dataclass(frozen=True) class PinnedIssuer: did: str version_id: str key_id: str key_material_sha256: str def pin_from_document(did: str, doc: dict) -> PinnedIssuer: vm = doc["verificationMethod"][0] return PinnedIssuer( did=did, version_id=doc["versionId"], key_id=vm["id"], key_material_sha256=hashlib.sha256(vm["publicKeyMultibase"].encode()).hexdigest(), ) def trust_root_continuous( pinned: PinnedIssuer, resolved_doc: dict, continuity_proof: dict | None, proof_verifier, ) -> bool: """True iff the resolved document is the same trust root as pinned, or a provable successor of it.""" if resolved_doc["versionId"] == pinned.version_id: current = pin_from_document(pinned.did, resolved_doc) return current.key_material_sha256 == pinned.key_material_sha256 # versionId changed: require a rotation proof signed by the pinned key. if continuity_proof is None: return False return proof_verifier( proof=continuity_proof, expected_signer_key_id=pinned.key_id, expected_signer_key_sha256=pinned.key_material_sha256, binds_to_version=resolved_doc["versionId"], ) def authorize_action( pinned_set: dict[str, PinnedIssuer], credential, resolve_did, fetch_continuity_proof, proof_verifier, revocation_check, ) -> None: """Gate a delegated action on trust-root continuity across the whole chain. Revocation is checked but is NOT a substitute for continuity. """ if revocation_check(credential): raise TrustRootDiscontinuity( f"credential {credential.id} is revoked; action denied" ) for issuer_did in credential.issuer_chain: pinned = pinned_set.get(issuer_did) if pinned is None: raise TrustRootDiscontinuity( f"issuer {issuer_did} not in pinned set; refusing to establish " f"trust root lazily mid-session" ) resolved = resolve_did(issuer_did) proof = fetch_continuity_proof(issuer_did, pinned.version_id, resolved["versionId"]) if not trust_root_continuous(pinned, resolved, proof, proof_verifier): raise TrustRootDiscontinuity( f"issuer {issuer_did} re-rooted {pinned.version_id} -> " f"{resolved['versionId']} without a valid continuity proof; " f"cached credential no longer authorized by the pinned principal" ) ```