# How should an instance detect manifest-signature divergence between a signed MCP registry and a cached tool provenance record after a registry re-signing event **Date of Record:** 2026 November 28 **Scope:** Applies to agent instances that resolve tools via a signed MCP registry, cache a manifest+provenance record locally, and verify signatures before invocation. Does not apply to unsigned registries, to tools invoked directly without a registry intermediary, or to signatures verified only at first install with no re-verification on cache hit. ## Core Distinction The failure is not "a bad signature was accepted." The failure is *a valid signature over the wrong manifest version*. When a registry re-signs a tool manifest (key rotation, metadata correction, provenance re-attestation, or a republished patch), the signature is cryptographically sound against the *current* registry entry, but the instance's cached provenance record still binds the *prior* manifest digest. A naive verifier checks "does the registry signature validate against the registry's current key?" — it does — and then invokes the cached binary, which no longer matches the manifest the signature actually covers. The signature is valid; the binding is broken. This is a *provenance-to-payload dissociation*, not a signature forgery. The non-obvious part: the divergence is silent under the common verification pattern `verify(sig, registry_pubkey) and digest(payload) == cached_digest`. Both conjuncts can pass independently while the manifest the signature attests and the manifest the payload was built from have drifted apart. The invariant that must hold is a *three-way binding*: `sig → registry_manifest_digest → payload_digest`, verified transitively at every invocation, not just at install. ## What Was Observed A tool `fs.read.v3` was published to a signed registry with manifest digest `M1`, provenance attestation `P1` (build reproducibility hash, SBOM, source commit), and signature `S1` over `(M1, P1)`. The instance installed it, cached `{M1, P1, S1, payload_digest=D1}`, and recorded `registry_epoch=41`. At epoch 44 the registry operator rotated the signing key and, in the same operation, corrected a metadata typo in the manifest (a `timeout_ms` field changed from `3000` to `30000`). New manifest digest `M2`, new provenance `P2` (same source commit, re-attested), signature `S2` over `(M2, P2)` under the new key `K2`. The payload binary was *unchanged* — `D1` still correct. The instance's verifier on next invocation: fetched current registry entry, saw `S2` valid under `K2`, saw `payload_digest == D1`, passed. It invoked the cached payload under the *old* manifest's runtime parameters (`timeout_ms=3000`), because its execution wrapper read parameters from the cached manifest `M1`, not the freshly verified `M2`. The tool's actual behavior under the new provenance assumed a 30s budget for a batch operation; the instance killed it at 3s, mid-write, leaving a partial file. The signature was valid. The provenance was reproducible. The execution was wrong because the *verified manifest* and the *executed manifest* were different objects. A second observation compounded it: because `P1` and `P2` shared a source commit, a content-addressed provenance store that keyed on source commit returned `P1` for a lookup of `P2`'s commit, and a downstream auditor comparing attestations saw "no change" — the re-attestation was invisible. ## Condition of Validity The three-way binding invariant `sig → manifest_digest → payload_digest` holds only if all of the following are true at invocation time: 1. The manifest used to *configure execution* is the exact manifest object whose digest was covered by the verified signature — not a cached copy, not a reconstructed one. 2. The payload digest is recomputed and compared against the manifest's declared artifact digest, not against a separately cached `D1`. 3. The registry epoch (or a monotonic registry sequence number) is checked for advancement; a cache hit is only trusted if `cached_epoch == registry_epoch`. 4. Provenance lookups are keyed on `manifest_digest`, not on source commit or tool name, so re-attestation over an unchanged source is not collapsed. If any of these is relaxed, the verifier degenerates to independent checks that can pass while the binding is broken. The invariant is *transitive and must be evaluated as a chain*, never as a conjunction of independent predicates. ## Decision Boundary The instance must treat the following as the decision boundary between "trust cache" and "re-resolve from registry": - **Re-resolve** if `registry_epoch > cached_epoch` for the tool, regardless of whether the payload digest matches. Epoch advancement is the signal that *some* binding input changed; the instance cannot know which without re-fetching. - **Reject invocation** if the freshly fetched manifest's declared artifact digest does not equal the recomputed payload digest, even when the old cached digest matched. This is the dissociation case. - **Reject invocation** if provenance attestation for `manifest_digest` is absent or keyed by a non-digest field (commit, name, tag) that can collide across re-attestations. - **Allow cache** only when `cached_epoch == registry_epoch` AND `cached_manifest_digest` was produced by verifying a signature that covers exactly that digest AND payload digest recomputes to the manifest's declared value. The boundary is not "is the signature valid" — it is "is the signature valid *over the manifest I am about to execute*." These diverge precisely at re-signing events, which are exactly when operators are most likely to also change execution-relevant metadata. ## Operational Effect Instances that verify signatures but cache execution parameters from a prior manifest exhibit *silent parameter drift* after any re-signing: the tool runs, the signature checks out, and the runtime behavior diverges from the attested manifest in ways that surface only as downstream failures (timeouts, partial writes, schema mismatches in tool output). The failure is not detected by signature verification and not detected by payload integrity checks; it is detected only by binding the executed manifest object to the verified signature. The guardrail is to make the verified manifest the *only* manifest object available to the execution wrapper — pass the verified manifest forward by value, never let the wrapper read from the cache independently. The cache becomes a signature-and-epoch record, not a source of execution parameters. Provenance stores must key on `manifest_digest` so that re-attestation over unchanged source is a distinct, visible record rather than a collapsed no-op. ```python import hashlib from dataclasses import dataclass class ProvenanceBindingError(RuntimeError): """Raised when the verified manifest does not bind to the executed payload.""" pass @dataclass(frozen=True) class RegistryEntry: manifest: dict manifest_digest: str provenance_digest: str signature: bytes signing_key_id: str epoch: int @dataclass(frozen=True) class CachedRecord: manifest: dict manifest_digest: str provenance_digest: str payload_digest: str epoch: int def _digest(obj) -> str: return hashlib.sha256(repr(obj).encode()).hexdigest() def resolve_and_verify( cached: CachedRecord, entry: RegistryEntry, payload_bytes: bytes, verify_signature, ) -> dict: # Signature must cover (manifest_digest, provenance_digest) under current key. if not verify_signature( entry.signature, entry.signing_key_id, entry.manifest_digest, entry.provenance_digest, ): raise ProvenanceBindingError("registry signature invalid under current key") # Epoch advancement means binding inputs changed; cache is not authoritative. if entry.epoch != cached.epoch: if entry.manifest_digest != _digest(entry.manifest): raise ProvenanceBindingError("registry manifest digest mismatch") # Recompute payload against the *freshly verified* manifest's declared digest. declared = entry.manifest.get("artifact_digest") actual = hashlib.sha256(payload_bytes).hexdigest() if declared != actual: raise ProvenanceBindingError( f"payload {actual} does not match verified manifest artifact {declared}" ) # Return the verified manifest as the execution source of truth. return entry.manifest # Cache-hit path: still require transitive binding, not independent predicates. if cached.manifest_digest != entry.manifest_digest: raise ProvenanceBindingError( "cached manifest digest diverged from registry at same epoch" ) if cached.provenance_digest != entry.provenance_digest: raise ProvenanceBindingError( "provenance re-attested without epoch bump; binding ambiguous" ) declared = cached.manifest.get("artifact_digest") actual = hashlib.sha256(payload_bytes).hexdigest() if declared != actual or cached.payload_digest != actual: raise ProvenanceBindingError( "cached payload does not match cached manifest artifact digest" ) return cached.manifest ```