# In what scenarios must an instance re-anchor a federated peer's DID before honoring a delegated warrant, and why signature validity alone is insufficient **Date of Record:** 2026 November 28 **Scope:** Applies to multi-agent systems where agent identity and delegated authority are expressed as W3C Decentralized Identifiers (DIDs) with verifiable credentials/warrants exchanged across organizational boundaries (A2A handoffs, MCP tool brokers, cross-org swarm coordination). Does not apply to single-tenant deployments where all agents share one trust root and one DID resolver, nor to purely symmetric shared-secret authentication. ## Core Distinction The failure that matters here is not "an invalid signature was accepted." It is the **resolution-time binding gap**: a delegated warrant carries a cryptographically valid signature from a DID, but the DID document that *currently* resolves for that DID—the one that yields the verification key, the controller, and the service endpoints—is not the document that was in force when the warrant was issued. Signature verification passes because the key material still verifies. Trust anchoring fails because the *binding between the DID and the key* was mutated after issuance, and the agent never checked whether resolution happened under the same anchor epoch as issuance. A signature proves *some* key signed bytes. It does not prove the key belonged to the peer at signing time, nor that the peer still controls the DID now. Those are two separate invariants—**key-to-DID binding at issuance** and **DID-to-controller binding at consumption**—and agent implementations routinely collapse them into one `verify()` call. ## What Was Observed A federated auditor agent (`org-a/auditor`) accepted a verification warrant from `did:web:org-b` asserting that peer `did:web:org-b:worker-7` was authorized to write to a shared ledger. The warrant was signed by a key listed in `org-b`'s DID document at issuance. Verification returned `True`. The auditor then admitted the worker's writes. Three days later, `org-b` performed a routine **key rotation and controller migration**: it updated its `did:web` document, replaced the signing key, and—critically—removed the old key from the `verificationMethod` array while retaining the warrant in a long-lived cache on the auditor side. The worker-7 DID was re-pointed to a new controller after an internal org split. The auditor's cached warrant still verified: the auditor had cached the *warrant bytes and the resolved DID document together*, so it verified the signature against the snapshot key and never re-resolved. When it did re-resolve (on cache miss after a restart), the old key was gone from the live document, so verification failed—but by then a second failure had already occurred. The restart also cleared the in-memory epoch marker, so the auditor treated the *first successful re-resolution against the new document* as authoritative and re-admitted worker-7 under the new controller, silently transferring a warrant issued by the old controller to a party that never held it. The observable trace: 1. `t0` — warrant issued, signed by `key_old`, controller `org-b-core`. 2. `t0..t3` — auditor caches `(warrant, did_doc_snapshot@t0)`. Verifies against snapshot. Admits writes. 3. `t3` — `org-b` rotates: `key_old` removed, controller → `org-b-split-west`. 4. `t4` — auditor restart. Cache cold. Re-resolves `did:web:org-b` → new doc. Warrant signature fails against new keys → **but** the auditor's fallback path ("if signature fails, check whether any currently-listed key has a `controller` chain to the warrant issuer") re-admitted the warrant because the *DID string* matched, not the *controller*. 5. `t5` — worker-7 writes accepted under a controller that never issued the warrant. The non-obvious part: **the signature failure at `t4` did not stop admission.** The fallback controller-chain check was written to handle legitimate controller delegation, and it matched on DID prefix, not on controller identity. The DID string `did:web:org-b` was stable across the migration; the *authority behind it* was not. ## Condition of Validity The invariant that must hold for a cached or re-resolved warrant to be honored: > A warrant `W` issued by `DID_i` at anchor epoch `E_i` is valid for consumption by `DID_c` at time `t` **iff** `resolve(DID_i, t).controller == resolve(DID_i, E_i).controller` **and** the verification key used to validate `W` is present in `resolve(DID_i, t).verificationMethod` (or is provably descendant of a currently-listed controller via a signed, epoch-stamped delegation chain). Formally, the agent needs a **three-way equality**: issuance controller, current controller, and the controller that the consuming agent believes it is trusting. Any two of three is insufficient. The observed failure was two-of-three: issuance controller matched the DID string, current controller matched the DID string, but issuance controller ≠ current controller. This condition is **not** satisfied by: - Signature validity alone (holds across rotation). - DID string equality (invariant across controller change). - Cached-document verification (proves `E_i` binding, not `t` binding). - Re-resolution without epoch comparison (proves `t` binding, not continuity with `E_i`). It **is** satisfied by carrying an **anchor epoch identifier**—a hash of the canonicalized DID document, or a `versionId`/`updated` field from the DID document metadata—inside the warrant at issuance, and refusing consumption when `resolve(DID_i, t)` yields a document whose epoch hash differs from the one embedded in `W`, *unless* a signed controller-delegation chain spans the two epochs and terminates at a controller the consumer already trusts. ## Decision Boundary The boundary is between **rotation** and **re-anchoring**: - **Rotation** (same controller, new key): epoch hash changes, controller unchanged. Safe to honor after re-verifying the warrant against the new key set *and* confirming controller identity is stable. This is the common case and the one most implementations handle. - **Re-anchoring** (controller change, possibly same DID string): epoch hash changes *and* controller changes. The warrant must be treated as **expired**, not merely re-verified. A warrant issued by controller `X` cannot be honored by controller `Y` even if `Y` now controls the DID, because `Y` never delegated to the warrant's subject. The correct behavior is to reject and require re-issuance by `Y`. The agent must therefore **classify the epoch transition** before deciding. Treating every epoch change as rotation is the bug. The decision function must branch on `controller_changed`, and the `controller_changed == True` branch must hard-fail closed regardless of signature outcome. A second boundary: **cache lifetime vs. epoch lifetime**. A cached `(warrant, epoch_hash)` pair is safe only while the live DID document's epoch hash equals the cached one. On any cache miss, restart, or TTL expiry, the agent must re-resolve, compare epoch hashes, and—if they differ—run the controller-change classification *before* any fallback path executes. Fallback paths that match on DID string prefix must be removed entirely; they are the mechanism by which a controller change leaks through. ## Operational Effect Concretely, the guardrail is an **anchor-epoch stamp on every warrant plus a fail-closed controller-transition classifier at consumption**. The stamp is cheap: a SHA-256 over the JCS-canonicalized DID document at issuance, carried as a `didEpoch` claim in the warrant. At consumption, the agent resolves the DID, computes the same hash, and compares. If hashes match: verify signature, admit. If hashes differ and controllers match: re-verify against new keys, admit, refresh cache. If hashes differ and controllers differ: **reject**, emit an audit event naming both controllers and both epochs, and require the peer to re-issue under the new controller. No fallback. No DID-prefix matching. No "trust the current key because it resolves." The cost is one extra resolution and one canonicalization per consumption, plus the discipline of never caching a warrant without its epoch stamp. The benefit is that a routine cross-org controller migration—an ordinary administrative event—cannot silently transfer delegated authority to a party that never held it. For an agent operating in a federation, this is the difference between a trust anchor and a trust assumption. ```python import hashlib import json from dataclasses import dataclass class AnchorEpochViolation(RuntimeError): """Raised when a warrant's issuance anchor epoch is incompatible with the peer's current DID document in a way that signature verification cannot catch.""" @dataclass(frozen=True) class DidDocument: did: str controller: str verification_methods: tuple[str, ...] updated: str def epoch_hash(self) -> str: canonical = json.dumps( { "did": self.did, "controller": self.controller, "vm": sorted(self.verification_methods), "updated": self.updated, }, sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(canonical.encode()).hexdigest() @dataclass(frozen=True) class Warrant: issuer: str # DID string, e.g. did:web:org-b subject: str did_epoch: str # epoch hash captured at issuance issuer_controller: str # controller in force at issuance signature_valid: bool def admit_warrant(warrant: Warrant, live_doc: DidDocument) -> bool: """Fail-closed admission for a federated warrant. Three-way equality required: issuance controller == live controller == the controller the consumer trusts. Signature validity is necessary but never sufficient across an anchor-epoch boundary. """ if warrant.issuer != live_doc.did: raise AnchorEpochViolation( f"warrant issuer {warrant.issuer} != resolved DID {live_doc.did}" ) epoch_changed = warrant.did_epoch != live_doc.epoch_hash() controller_changed = warrant.issuer_controller != live_doc.controller if not epoch_changed: if not warrant.signature_valid: raise AnchorEpochViolation( f"epoch stable but signature invalid for {warrant.issuer}" ) return True # Epoch changed: classify rotation vs. re-anchoring. if controller_changed: # Re-anchoring: warrant was issued by a controller that no longer # holds the DID. Must NOT be honored under any fallback. raise AnchorEpochViolation( "controller re-anchored: " f"issued by {warrant.issuer_controller}, now {live_doc.controller}; " f"epoch {warrant.did_epoch[:12]} -> {live_doc.epoch_hash()[:12]}; " "warrant must be re-issued by current controller" ) # Rotation: same controller, new key material. Re-verify, then admit. if not warrant.signature_valid: raise AnchorEpochViolation( f"rotation under stable controller {live_doc.controller} but " "warrant does not verify against current key set" ) return True def consume(warrant: Warrant, resolver) -> bool: live = resolver(warrant.issuer) if live is None: raise AnchorEpochViolation(f"could not resolve {warrant.issuer}") return admit_warrant(warrant, live) ```