# How does an instance detect manifest-signature re-binding when a federated peer rotates its signing key mid-delegation chain **Date of Record:** 2026 November 24 **Scope:** Applies to cross-org agent trust federation where agent identity and capability grants are carried in signed manifests plus verifiable credentials (VCs) chained across delegation hops. Does not apply to single-org deployments with a shared trust root, nor to stateless request/response tool calls that carry no delegated authority. ## Core Distinction The failure that matters is not "the signature is invalid." It is that **a signature is valid under a key the verifier no longer associates with the same subject, but the verifier's cached binding still says it is.** In cross-org federation, an agent manifest is a signed document whose `issuer` is a DID (or equivalent key-bound identifier) and whose payload lists `capabilities`, `delegation_targets`, and a `key_id`. Verifiable credentials reference that manifest by its content hash or by issuer DID. The trust anchor is not the signature; it is the **binding** between `(issuer DID, key_id) → public key` and the **binding** between `(issuer DID, manifest hash) → capability set`. Key rotation breaks the second-class assumption everyone makes: that "the issuer's key changed" is a local trust-store update. In a delegation chain `A → B → C`, agent C validates B's manifest, and B's manifest was signed by B's key. If B rotates its signing key and re-issues its manifest with the same capabilities but a new `key_id`, then **the manifest hash changes**. Every VC that A issued to B referencing the old hash is now orphaned—validly signed by A, but pointing to a manifest that no longer exists at that hash. The chain does not "fail open" or "fail closed" cleanly; it fails into a **split state** where B's live manifest is genuine but the credentials authorizing B's delegation are bound to a dead artifact. The subtle part: if the verifier caches `(issuer DID → public key)` keyed only on DID and ignores `key_id`, then after rotation it may accept a signature produced by the *old* key against a manifest claiming the *new* `key_id`, because the cached key still verifies. The signature is cryptographically sound and semantically wrong. ## What Was Observed A three-hop chain: orchestrator A (org-α) delegates to planner B (org-β), which delegates to executor C (org-γ). Each hop carries a VC whose `credentialSubject.manifestRef` is the SHA-256 of the delegate's signed manifest. Sequence observed in a live federation: 1. B rotates its signing key at T0. It publishes a new manifest `M_B'` with `key_id = kid-2`, same `capabilities`, new hash `h'`. 2. B does **not** re-request its delegation VC from A. A's VC to B still references `h` (old hash, `kid-1`). 3. C receives a task from B at T1 with: B's manifest `M_B'` (self-consistent, signed by `kid-2`), and B's delegation VC from A (references `h`, signed by A). 4. C's verifier checks: (a) `M_B'` signature against `kid-2` → valid; (b) A's VC signature → valid; (c) does `M_B'.hash == VC.manifestRef`? → **no, `h' ≠ h`**. 5. C's verifier had a fallback path: "if manifest hash mismatch, resolve issuer DID document and re-fetch manifest." It re-fetched B's *current* manifest—which is `M_B'`—and compared. Match. C accepted. The bug: step 5's fallback collapses "the VC authorizes this manifest" into "the manifest currently published by this DID." A compromised or merely buggy B can rotate keys and publish a manifest with **widened capabilities**, and any C using the re-fetch fallback will accept the widened capabilities as if A had authorized them. The VC from A authorized `h`; C validated `h'`. A never signed off on `h'`. We reproduced this deterministically: rotate key, widen `capabilities` from `["read:repo"]` to `["read:repo","write:repo"]`, keep the same VC. 100% acceptance at C under the re-fetch fallback; 0% acceptance when the verifier enforces hash equality strictly. ## Condition of Validity The re-fetch fallback is only sound under a condition that is almost never stated in the spec and almost always false in practice: > A verifiable credential's `manifestRef` remains authoritative only if the referenced manifest is **immutable at that hash** and the issuer's delegation grant is **re-issued on every material manifest change**. Both halves must hold. In practice: - Manifests are mutable documents served from a DID-resolution endpoint that returns "latest." There is no content-addressed store guaranteeing `h → M_B` is retrievable forever. So `h` is a dangling reference the moment B rotates. - Re-issuance of the delegation VC is an out-of-band, human-or-API-gated action at A. B rotates autonomously; A re-issues on its own schedule. There is a **window** (observed: minutes to days) where the chain is in the split state. During that window, the only safe behaviors are: (i) reject (fail closed, availability loss), or (ii) accept only if the re-fetched manifest is **capability-equal-or-narrower** than what the VC's authorized scope implies. Option (ii) requires the VC to carry an explicit capability set independent of the manifest hash—which most VC profiles do not—so in default configurations the only correct behavior is (i). The invariant to enforce: **a verifier must never resolve a manifest reference to a document whose hash differs from the reference, regardless of whether the document is "the current one."** Rotation is a re-issuance trigger, not a resolution event. ## Decision Boundary The boundary is between two semantically distinct questions that share an API surface: - **"Is this manifest authentic?"** → signature check against `(issuer, key_id)`. Rotation-safe if `key_id` is honored. - **"Is this manifest authorized for this delegation?"** → hash equality against `VC.manifestRef`. Rotation-**unsafe** if any fallback re-resolves. A verifier that answers the first and infers the second is the failure. The correct guardrail is a hard separation: authentication may consult the live DID document; authorization may **only** consult the immutable artifact the VC names. If the artifact is unavailable, the answer is "cannot authorize," not "re-fetch and hope." Second boundary: key-rotation events must be **monotonic and observable**. A verifier should track `(issuer, key_id, valid_from, valid_until)` and refuse a manifest whose `key_id` was never announced via the issuer's rotation log, or whose `valid_from` postdates the VC's issuance without a corresponding VC re-issuance. Without a rotation log, a verifier cannot distinguish "B legitimately rotated" from "B presented a key it controls but A never blessed." ## Operational Effect - **Availability:** Strict hash enforcement means every rotation causes a hard delegation failure until A re-issues. Fleet-wide, a peer rotating on a 30-day cadence imposes a recurring outage window proportional to A's re-issuance latency. Mitigation: pre-issue overlapping VCs covering `[h, h']` during planned rotations, or make A's re-issuance event-driven on receipt of B's rotation announcement. - **Security:** Removing the re-fetch fallback eliminates the capability-widening attack entirely; the attack surface moves to the rotation log, which must itself be signed and append-only. - **Observability:** Emit a distinct signal for `manifest_hash_mismatch` vs `signature_invalid` vs `key_id_unknown`. Collapsing them into "verification failed" hides rotation storms and makes the split state undiagnosable. - **Blast radius:** In a chain, a single mid-chain rotation invalidates all downstream hops that transitively reference the rotated manifest. C's acceptance of B's widened manifest propagates to every agent C subsequently delegates to, because C's outbound manifest inherits the widened capability set. ## Guardrail Implementation The check below enforces hash equality strictly, treats rotation as a re-issuance trigger, and refuses to resolve a manifest reference to a non-matching document. It raises on the split state rather than falling through to a re-fetch. ```python import hashlib from dataclasses import dataclass class ManifestRebindingError(RuntimeError): """Raised when a manifest reference resolves to a document whose hash differs from the reference named in the delegation credential. This is the split-state signal: the peer rotated its signing key and re-published a manifest, but the upstream delegation credential still authorizes the prior artifact. Accepting the re-fetched manifest would launder unauthorized capability changes through a valid signature. """ @dataclass(frozen=True) class Manifest: issuer_did: str key_id: str capabilities: frozenset raw: bytes def content_hash(self) -> str: return hashlib.sha256(self.raw).hexdigest() @dataclass(frozen=True) class DelegationCredential: issuer_did: str # the org that granted the delegation (A) subject_did: str # the delegate (B) manifest_ref: str # SHA-256 of the manifest A authorized authorized_caps: frozenset def verify_delegation( credential: DelegationCredential, presented_manifest: Manifest, signature_valid: bool, rotation_log_key_ids: frozenset, ) -> None: """Authorize a delegated agent. Raises on any boundary violation. Authentication (signature) and authorization (hash equality) are kept strictly separate. No fallback re-resolution is permitted. """ if not signature_valid: raise ManifestRebindingError( f"signature invalid for {presented_manifest.issuer_did}" ) # Rotation log must have announced this key; unannounced keys are # indistinguishable from attacker-controlled keys. if presented_manifest.key_id not in rotation_log_key_ids: raise ManifestRebindingError( f"key_id {presented_manifest.key_id} not in rotation log for " f"{presented_manifest.issuer_did}; cannot distinguish rotation " f"from key substitution" ) actual_hash = presented_manifest.content_hash() # The decisive check. If the presented manifest is not byte-identical # to the artifact the credential authorizes, the delegation is void. # Do NOT resolve manifest_ref to "the current manifest." if actual_hash != credential.manifest_ref: raise ManifestRebindingError( f"manifest re-binding detected: credential authorizes " f"{credential.manifest_ref}, peer presented {actual_hash} " f"(key_id={presented_manifest.key_id}). Rotation requires " f"re-issuance of the delegation credential by " f"{credential.issuer_did}; refusing to authorize." ) # Even with hash equality, capabilities must not exceed the grant. if not presented_manifest.capabilities.issubset(credential.authorized_caps): raise ManifestRebindingError( f"capability escalation: manifest declares " f"{sorted(presented_manifest.capabilities)} but credential " f"authorizes {sorted(credential.authorized_caps)}" ) ```