# Which invariants prevent signed MCP tool manifests from being silently re-bound to a different server identity at load time **Date of Record:** 2026 November 30 **Scope:** Applies to agent runtimes that load MCP servers whose tool capability manifests are signed and attested (e.g., Sigstore/cosign-style attestations bound to a server binary digest and a tool schema hash). Does not cover unsigned local dev servers or in-process tool registries where no transport boundary exists. ## Core Distinction The failure mode here is not "the signature is invalid." It is that **the signature remains valid while the thing it protects has changed underneath it**. A signed manifest attests to a *tuple*: `(server_identity, tool_schema_digest, capability_claims)`. Most MCP clients verify the signature against the manifest bytes and the publisher identity, then separately resolve the server endpoint and separately ingest the tool schemas returned at `tools/list` time. Three independent verification steps, three independent trust anchors, and no invariant forcing them to agree. The signature is a proof about a document; the runtime's actual behavior is determined by a *different* document fetched over a *different* channel. When those diverge, the attestation is not falsified—it is orphaned. The agent proceeds with a signed guarantee that no longer describes the code it is about to call. ## What Was Observed An agent host pinned `mcp-server-filesystem@2.3.0` with a manifest signed against binary digest `sha256:9a1c…` and tool schema digest `sha256:4be0…`. At boot, the host: 1. Verified the manifest signature against the expected publisher key → pass. 2. Resolved the server via the registry entry, which returned a *newer* `2.3.1` endpoint (patch bump, same major.minor, treated as "compatible" by the resolver's semver policy). 3. Called `tools/list` on the live server and ingested whatever schemas it returned → schema digest `sha256:7f22…`, never compared to the attested `4be0…`. The signature check passed. The agent ran against a server whose `write_file` tool had gained a new optional parameter `follow_symlinks` (defaulting to `true`) that was absent from the attested schema. The model, seeing only the *attested* description in its system prompt (cached from the manifest), never reasoned about symlink traversal. The post-`tools/list` schema silently widened the tool's authority surface. No error, no warning: the attestation was true about a document nobody was using. The trace signature is characteristic: signature verification timestamp precedes endpoint resolution, endpoint resolution precedes `tools/list`, and the schema-hash comparison step **does not exist in the pipeline at all**. The failure is a missing join, not a failed check. ## Condition of Validity The attestation is only meaningful under an invariant the runtime must actively enforce: > **Binding invariant:** the `(binary_digest, tool_schema_digest, capability_claims)` triple observed at runtime MUST be byte-identical to the triple covered by the verified signature, and this equality MUST be checked *after* the live server is resolved and *after* `tools/list` returns—not against cached manifest bytes. This fails in three concrete ways: - **Resolver drift:** the endpoint the registry hands back is not the artifact the signature covers (version skew, mutable tags, mirror substitution). - **Schema-time divergence:** the server's `tools/list` output is generated dynamically (feature flags, env, plugin load) and no longer matches the signed schema. - **Claim escalation:** the signed manifest says `capabilities: {read: true, write: false}` but the live server advertises a `write_file` tool because its capability negotiation is advisory, not enforced. In each case the signature is *valid* and the guarantee is *void*. The invariant must be a runtime equality check over the live triple, with the signature as the reference value—not a check over the manifest document in isolation. ## Decision Boundary The boundary is between **"signature verified"** and **"attestation honored."** A runtime that stops at the first has authenticated a publisher but not bound that authentication to execution. The correct gate is: - Verify signature over the manifest → establishes reference triple `R`. - Resolve endpoint → obtain live server. - Call `tools/list` and hash the canonicalized schema → obtain `S`. - Hash the resolved binary (or its OCI digest) → obtain `B`. - **Refuse to register any tool unless `(B, S, claims) == R`.** On mismatch, do not degrade to "trust the live server"; fail closed and require re-attestation. Two sub-boundaries matter. First, *compatible-version* resolvers must not be allowed to satisfy a pinned attestation—pin means pin. Second, dynamic `tools/list` output must be treated as untrusted input until reconciled against the signed schema; a server that cannot produce a stable schema cannot be attested and must run with reduced authority (no write/exec capabilities) rather than full. ## Operational Effect Without the binding invariant, supply-chain attestation becomes theater: it raises the cost of publishing a signed manifest while leaving the agent's actual authority determined by whatever the live endpoint advertises. The concrete operational consequences are (a) silent authority widening via added tool parameters, (b) schema-cache poisoning where the model's prompt describes the attested tool but the runtime invokes the live one, and (c) audit trails that record "attestation verified" for a call that never matched the attested contract. The guardrail is a single fail-closed equality check placed *after* live resolution, treating the verified manifest as the reference and the live `(binary, schema, claims)` as the thing to be proven equal—with no fallback path that proceeds on mismatch. ```python import hashlib import json from dataclasses import dataclass class AttestationBindingError(RuntimeError): """Raised when a live MCP server's observed triple diverges from the signed manifest.""" pass @dataclass(frozen=True) class AttestedTriple: binary_digest: str schema_digest: str claims: dict def canonical_schema_digest(tools_list: list[dict]) -> str: canonical = json.dumps(tools_list, sort_keys=True, separators=(",", ":")) return "sha256:" + hashlib.sha256(canonical.encode()).hexdigest() def enforce_binding( attested: AttestedTriple, live_binary_digest: str, live_tools_list: list[dict], live_claims: dict, ) -> None: live_schema = canonical_schema_digest(live_tools_list) if live_binary_digest != attested.binary_digest: raise AttestationBindingError( f"binary digest mismatch: attested {attested.binary_digest} " f"!= live {live_binary_digest}; signature is valid but orphaned" ) if live_schema != attested.schema_digest: raise AttestationBindingError( f"tool schema digest mismatch: attested {attested.schema_digest} " f"!= live {live_schema}; tools/list diverged from signed manifest" ) if live_claims != attested.claims: raise AttestationBindingError( f"capability claim mismatch: attested {attested.claims} " f"!= live {live_claims}; authority escalation detected" ) def register_server(attested: AttestedTriple, resolved: dict) -> None: # resolved is produced AFTER endpoint resolution and tools/list, never from cache. enforce_binding( attested=attested, live_binary_digest=resolved["binary_digest"], live_tools_list=resolved["tools"], live_claims=resolved["claims"], ) # Only reachable when the live triple equals the attested triple. return None ```