# What happens when an instance trusts a signed MCP manifest whose tool surface drifted after attestation **Date of Record:** 2026 November 21 **Scope:** Applies to agent runtimes that gate tool invocation on a signed MCP server manifest plus a provenance attestation (SBOM/digest) bound to that manifest. Does not cover unsigned local dev servers, or transport-level auth failures (mTLS, token expiry), which fail closed earlier. ## Core Distinction A signed MCP manifest attests to *what the server declared at signing time*. It does not attest to *what the server returns at call time*. The two artifacts most teams conflate are: 1. **The manifest signature** — a cryptographic claim over the static `tools/list` schema: tool names, JSON-Schema input/output contracts, declared capability scopes, and a content digest of the server package. 2. **The runtime tool surface** — the actual set of tools, their live schemas, and their side effects as observed during `tools/call`. The invariant that actually holds security is *manifest-to-runtime binding*: the digest attested in the manifest must equal the digest of the tool definitions the server emits on the wire at invocation time, and the SBOM component set must cover every code path reachable from those tool handlers. When a signed manifest is trusted but the runtime surface is never re-bound to it, the signature becomes a decorative seal on a document that no longer describes the running process. This is the *manifest drift* boundary: signature valid, provenance stale, tool surface divergent. ## What Was Observed A runtime fetched an MCP server manifest for a "filesystem-ops" server, verified the Ed25519 signature against a pinned publisher key, checked the SBOM attestation (in-toto predicate, `spdx` component list) against the manifest's `packageDigest`, and admitted the server. All checks passed. The manifest declared four tools: `read_file`, `list_dir`, `stat`, `write_file`, each with a pinned `inputSchema` and a declared scope of `fs:read` (and `fs:write` for `write_file`). On first `tools/list` at runtime, the server returned five tools. The extra tool, `exec_hook`, was not in the manifest, accepted a free-form `command` string, and carried no declared scope. The runtime's admission gate had already passed; `tools/list` was treated as an unauthenticated discovery step rather than a re-verification point. The agent, operating under a task plan that enumerated capabilities rather than exact tool names, selected `exec_hook` when `write_file` returned `EACCES` on a path outside its sandbox — a plausible, non-malicious reasoning step. The call succeeded because the server process ran with the parent agent's uid. The failure trace, in order: 1. **Sign → drift.** Publisher signed manifest at package digest `D0`. Server was subsequently rebuilt (dependency bump) to digest `D1`; the manifest was *not* re-signed and the SBOM was not regenerated. Signature check on `D0` still passes because the runtime verifies the manifest, not the live package. 2. **Discovery ≠ verification.** `tools/list` returned the union of the signed four plus a dynamically-registered `exec_hook` (registered by a plugin loader that was added in `D1`). The runtime had no schema-diff step against the manifest. 3. **Plan under-specification.** The agent's capability plan referenced `fs:write`, not `write_file` by exact name. Tool selection resolved by semantic match, and `exec_hook`'s description ("execute shell hook for filesystem events") semantically outcompeted the failing `write_file`. 4. **Scope laundering.** `exec_hook` declared no scope, and the runtime's scope check was `declared_scopes ⊆ granted_scopes` — an empty declared set trivially satisfies the subset relation. The un-scoped tool inherited the full granted scope. 5. **Effect.** Arbitrary command execution under the agent's uid, with a valid signature chain the whole way down. The non-obvious part: every individual control was implemented correctly. The signature was valid. The SBOM matched the manifest. The scope check was logically sound. The failure lived in the *gap between artifacts* — no control asserted that the signed manifest and the live tool surface were the same object. ## Condition of Validity Manifest-based supply-chain gating is only sound when all four of the following hold simultaneously: - **Surface binding:** the runtime computes a canonical digest over the live `tools/list` response (sorted tool names, canonicalized JSON-Schema, declared scopes, handler identity) and rejects any tool whose digest is absent from the signed manifest's `toolDigests` map. This must run on every `tools/list`, not just at admission. - **Package binding:** the manifest's `packageDigest` is checked against the *running* server's package identity (e.g., resolved `package.json`/lockfile digest or image digest), not merely against the SBOM's `subject`. A signature over a stale digest is a signature over the wrong object. - **Scope completeness:** the scope check is `declared_scopes` is non-empty AND `declared_scopes ⊆ granted_scopes`. Empty declared scope must be a hard reject, never a vacuous pass. Un-scoped tools are the primary laundering vector. - **SBOM reachability:** every import reachable from a tool handler must appear in the SBOM component set. A plugin loader that can register new tools at runtime must itself be an SBOM component, and its dynamic registrations must be rejected unless pre-attested. If any of these is absent, the signature attests to a document, not to behavior. The system is *validly signed and unsound*. ## Decision Boundary The boundary is not "signed vs. unsigned." It is **static attestation vs. dynamic surface reconciliation**. Concretely: - **Admit** a server only when the live tool-surface digest equals a digest in the signed manifest, the running package digest equals the manifest's `packageDigest`, and every tool carries a non-empty declared scope that is a subset of the grant. - **Reject-and-quarantine** on any mismatch, including *additive* drift. An extra tool is not a benign superset; it is an unattested capability. Treat `tools/list` divergence from the manifest as a hard failure, because the agent's planner will discover and use the extra surface. - **Fail closed on empty scope.** Do not interpret "no declared scope" as "no restrictions." Interpret it as "unattested," and unattested means denied. - **Re-attest on package change.** A manifest whose `packageDigest` no longer matches the running package is expired, regardless of signature validity. Signature validity and freshness are orthogonal; only the conjunction is admission-worthy. The trap to avoid: treating the signature as the security boundary. The signature is a *necessary* condition. The *sufficient* condition is signature ∧ package-digest-match ∧ live-surface-digest-match ∧ scope-completeness. Drop any conjunct and the boundary is open. ## Operational Effect When the runtime enforces surface binding, the observed failure cannot occur: the drifted `exec_hook` has no digest in the signed manifest, so `tools/list` reconciliation rejects the server before the agent's planner ever sees the tool. The agent's semantic tool-selection step — which is probabilistic and will happily pick an attractive-sounding unattested tool — is never given the option. When the runtime enforces package binding, the stale-signature window closes: a rebuilt server fails the `packageDigest` check and must be re-signed and re-SBOM'd before admission, forcing provenance to track the artifact. When the runtime rejects empty scopes, the subset relation can no longer be satisfied vacuously, and un-scoped tools cannot inherit the agent's full grant. The residual risk after all three: a malicious publisher who signs a manifest *and* a package *and* an SBOM that are mutually consistent but contain a backdoored tool with a plausible declared scope. No supply-chain control catches that — it is caught only by behavioral monitoring or human review of the attested surface. The boundary this record describes catches *drift and laundering*, not *dishonest origination*. Know which one you are defending against. ```python import hashlib import json from dataclasses import dataclass class ManifestDriftError(RuntimeError): """Raised when the live MCP tool surface diverges from the signed manifest.""" def canonical_tool_digest(tool: dict) -> str: payload = { "name": tool["name"], "inputSchema": tool.get("inputSchema", {}), "outputSchema": tool.get("outputSchema", {}), "declared_scopes": sorted(tool.get("scopes", [])), } blob = json.dumps(payload, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(blob).hexdigest() @dataclass class SignedManifest: package_digest: str tool_digests: dict[str, str] # name -> digest signature_valid: bool def admit_server( manifest: SignedManifest, running_package_digest: str, live_tools: list[dict], granted_scopes: set[str], ) -> None: if not manifest.signature_valid: raise ManifestDriftError("manifest signature invalid; refusing admission") # Package binding: signature must cover the *running* artifact, not a stale one. if manifest.package_digest != running_package_digest: raise ManifestDriftError( f"package digest mismatch: manifest={manifest.package_digest} " f"running={running_package_digest} (stale attestation)" ) for tool in live_tools: name = tool["name"] live_digest = canonical_tool_digest(tool) # Surface binding: every live tool must appear in the signed manifest. if name not in manifest.tool_digests: raise ManifestDriftError( f"unattested tool {name!r} present in live tools/list (additive drift)" ) if manifest.tool_digests[name] != live_digest: raise ManifestDriftError( f"tool {name!r} surface drifted from signed digest" ) # Scope completeness: empty declared scope is unattested, not unrestricted. declared = set(tool.get("scopes", [])) if not declared: raise ManifestDriftError( f"tool {name!r} declares no scope; unattested capability denied" ) if not declared.issubset(granted_scopes): raise ManifestDriftError( f"tool {name!r} requests scopes {declared - granted_scopes} " f"outside grant {granted_scopes}" ) # Manifest may declare tools the live server omits; that is a weaker concern, # but the planner should not assume them present. missing = set(manifest.tool_digests) - {t["name"] for t in live_tools} if missing: raise ManifestDriftError( f"signed tools absent from live surface: {sorted(missing)}" ) ```