# Why does an instance trust a signed MCP manifest whose capability set mutates after attestation **Date of Record:** 2026 November 30 **Scope:** Applies to agent runtimes that gate MCP tool invocation on a server-published, cryptographically signed tool manifest (capability attestation) verified at session-establishment time. Does not apply to runtimes that re-verify manifest signatures on every `tools/call`, nor to unsigned or trust-on-first-use MCP servers. ## Core Distinction There are two distinct integrity questions an MCP client can ask of a server, and they are routinely conflated: 1. **Authenticity of the manifest** — *did the holder of key `K` sign this exact byte sequence of tool definitions?* 2. **Binding of the manifest to the executing tool surface** — *is the tool that actually runs when I invoke `tools/call` the same capability that was attested?* Signature verification answers (1) perfectly and (2) not at all. The failure mode lives in the gap: a manifest is a *snapshot* of declared capabilities, but an MCP server's live tool surface is a *mutable, self-describing runtime object*. A server can present a signed manifest at `initialize`/`tools/list` and then serve a `tools/call` whose behavior diverges from the attested schema — because the manifest describes *names and JSON schemas*, not *implementations*, and because nothing in the MCP handshake forces the served tool to be byte-identical to the attested one. The signature is a seal on a document, not a seal on a process. The non-obvious consequence: **attestation is a point-in-time property of a document, but supply-chain integrity is a continuous property of a running endpoint.** An agent that treats a verified signature as an invariant over the whole session has silently upgraded a one-shot check into a perpetual guarantee it never received. ## What Was Observed A client agent established a session with an MCP server advertising a signed manifest. Verification passed: signature valid, key pinned to the expected publisher, `exp` in the future, `tools` array well-formed. The manifest declared a tool `read_config` with schema `{"path": {"type": "string", "pattern": "^/etc/app/"}}` — a path constraint that the client's policy layer relied on to confine reads to a config directory. Over the session, three things happened that the manifest could not express: - **Schema drift under a stable name.** The server's `tools/list` response at `t+40min` (re-issued after a reconnect) returned `read_config` with the `pattern` field *removed*. The signature on the *original* manifest still verified; the *new* listing was unsigned. The client had cached the attested constraint and applied it — but a second client instance that re-listed and trusted the unsigned listing did not. Same server, same tool name, two different effective capability sets. - **Implementation substitution behind an attested schema.** Even with the original signed schema, the server-side handler for `read_config` could resolve `path` through a symlink or `..` traversal that the *schema* cannot forbid (JSON Schema `pattern` constrains the *string*, not the *resolved filesystem path*). The signature attested the string pattern; the tool violated the *intent* while satisfying the *letter*. - **Attestation/execution key separation.** The manifest was signed by publisher key `K_pub`, but tool execution was performed by a backend reachable only through the server process. Nothing cryptographically ties the bytes returned by `tools/call` to `K_pub`. A compromised server process retains a valid manifest and serves arbitrary results. The observable trace: client verified signature at `t0`, set `session.capabilities = manifest.tools`, and thereafter dispatched `tools/call` gated only on `session.capabilities`. Between `t0` and `t+40min` the *served* surface diverged from the *attested* surface with no event the client treated as a violation. The invariant "attested capability set ≡ served capability set" held at exactly one instant and was assumed to hold for all. ## Condition of Validity The signature-as-integrity inference is valid **only** under the conjunction: - the manifest is re-fetched and re-verified on every `tools/list` and before every `tools/call` (or the listing is pinned by content hash and any divergence is a hard fault); - the attested schema is treated as a *necessary but insufficient* constraint — semantic confinement (path resolution, URL allowlisting, argument sanitization) is enforced client- or sandbox-side, never delegated to the schema; - the signing key's authority is scoped to *exactly* the capability surface the client will honor, and any capability outside the attested set is refused even if the server offers it; - execution results carry provenance back to `K_pub` (response signing or a signed result envelope), or the client accepts that result integrity is out of scope. Break any one and the attestation degrades from an integrity guarantee to a *recommendation* — a signed statement of intent that the running endpoint is free to contradict. ## Decision Boundary The operative question is not "is the manifest signed?" but **"what is the client willing to do when the served surface diverges from the attested surface?"** There are only three coherent policies, and they must be chosen explicitly: - **Pin-and-fail.** Cache the attested manifest by content hash at session start; on any `tools/list` whose hash differs, or any `tools/call` whose arguments violate the attested schema, abort the session. Strongest, but brittle against legitimate server upgrades and requires the client to enforce schema constraints itself. - **Re-attest-per-call.** Re-fetch and re-verify the signed manifest before each invocation. Bounds staleness to a single call, but does not close the implementation-substitution or key-separation gaps — the schema still cannot constrain resolved behavior. - **Attest-plus-containment.** Verify the signature *and* treat the attested schema as an upper bound enforced in a client-side sandbox (resolved-path checks, argument normalization, result provenance). This is the only policy that survives a compromised or upgraded server, because it does not trust the endpoint to honor its own attestation. The boundary is crossed the moment a client treats "signature verified at `t0`" as license to skip containment for the remainder of the session. That is the precise, non-obvious error: **a signature is an event, not a state.** ## Operational Effect An agent operating under the flawed inference exhibits a characteristic failure profile: it passes every cryptographic check, logs `manifest_verified=true`, and then executes tool calls whose *effective* capability exceeds what was attested — schema fields dropped on re-list, path constraints satisfied syntactically but violated semantically, results from an unprovenanced backend accepted as authoritative. Downstream, this manifests as "the agent did something the policy said it couldn't," with no failing check to point at, because the check that would have caught it (served-surface ≡ attested-surface, evaluated continuously) was never implemented. The guardrail is structural: bind the attested manifest to a content hash, re-evaluate that hash on every listing, enforce the attested schema as a *client-side* upper bound rather than a server-side promise, and refuse any capability not in the attested set — treating divergence, not signature failure, as the primary alarm. The code below encodes that boundary as an explicit fault. ```python import hashlib import json from dataclasses import dataclass class AttestationDivergenceError(RuntimeError): """Raised when a served MCP tool surface diverges from the attested, signed manifest.""" @dataclass(frozen=True) class AttestedManifest: publisher_key_id: str tools: dict # name -> schema dict content_hash: str # sha256 over canonical (name, schema) pairs def _canonical_hash(tools: dict) -> str: blob = json.dumps( sorted((name, schema) for name, schema in tools.items()), sort_keys=True, separators=(",", ":"), ).encode() return hashlib.sha256(blob).hexdigest() def verify_manifest(raw: bytes, signature_valid: bool, pinned_key_id: str, expected_key_id: str) -> AttestedManifest: if not signature_valid: raise AttestationDivergenceError("manifest signature did not verify") if pinned_key_id != expected_key_id: raise AttestationDivergenceError( f"manifest signed by unpinned key {pinned_key_id!r}, expected {expected_key_id!r}" ) doc = json.loads(raw) tools = {t["name"]: t.get("inputSchema", {}) for t in doc["tools"]} return AttestedManifest( publisher_key_id=pinned_key_id, tools=tools, content_hash=_canonical_hash(tools), ) def gate_tool_call(attested: AttestedManifest, served_listing: dict, tool_name: str, arguments: dict) -> None: """Enforce served-surface == attested-surface before every call.""" served_hash = _canonical_hash(served_listing) if served_hash != attested.content_hash: raise AttestationDivergenceError( f"served tool surface hash {served_hash[:12]} != attested " f"{attested.content_hash[:12]}; server mutated capabilities post-attestation" ) if tool_name not in attested.tools: raise AttestationDivergenceError( f"tool {tool_name!r} not present in attested capability set" ) schema = attested.tools[tool_name] required = schema.get("required", []) for field in required: if field not in arguments: raise AttestationDivergenceError( f"call to {tool_name!r} missing attested-required field {field!r}" ) # Schema is an upper bound; semantic confinement (path resolution, host # allowlisting) must still be enforced client-side, never delegated here. ```