# Where must an instance refuse to load a signed MCP manifest when the signature verifies but the tool set drifts from its provenance attestation **Date of Record:** 2026 November 23 **Scope:** Applies to agent runtimes that admit tools via signed MCP server manifests carrying an in-toto/SLSA-style provenance attestation and a tool-SBOM digest. Does not cover unsigned local dev servers, nor runtime tool *output* verification (that is a separate boundary). ## Core Distinction Signature validity and *supply-chain identity* are orthogonal invariants. A valid Ed25519 signature over a manifest proves only that the holder of a key authored *these bytes*. It says nothing about whether those bytes describe the same tool set that the provenance attestation and SBOM were built against. The dangerous boundary is the **manifest-attestation join**: the manifest is signed by an authorized publisher, the attestation verifies against its builder identity, and yet the *set of tools the manifest declares to expose* diverges from the *set of tools the SBOM attests were built into the artifact*. Every individual cryptographic check passes; the composite identity is a lie. This is not a TOCTOU race and not a key-compromise scenario. It is a **semantic join failure** across two independently-signed documents that the loader is expected to reconcile but naively does not, because each is verified in isolation and the join is treated as a soft "consistency check" rather than a hard admission gate. ## What Was Observed A publisher rotated a tool from `fs.read_v2` to `fs.read_v3` inside the MCP server binary and rebuilt the container. The SBOM (SPDX) was regenerated and correctly lists `fs.read_v3`; the provenance attestation's `subject` digest matches the new image. The signed MCP manifest, however, was regenerated from a stale `tools/list` cache captured before the rebuild and still advertises `fs.read_v2` with its old JSON-Schema. All three artifacts verify: - manifest signature → valid, publisher key, correct keyid; - attestation DSSE envelope → valid, builder identity matches policy; - SBOM → valid, subject digest equals the container digest the runtime actually pulled. The runtime admits the server. On first `tools/call`, the agent sends `{"name":"fs.read_v2", ...}`. The server, built from the new image, has no such tool and returns JSON-RPC `-32601 Method not found`. The agent's planner, which had already committed a multi-step plan keyed on the `fs.read_v2` schema (different argument shape: `path` vs `paths[]`), does not treat `-32601` as a manifest-integrity fault — it treats it as a transient tool error and retries with backoff, then falls back to a *different* tool the manifest also advertised (`fs.read_dir`) to approximate the intent. The plan silently degrades: it reads a directory listing instead of file contents, and downstream reasoning proceeds on garbage context. No admission-time signal fired, because every signature was green. The tell, when it was finally found in traces, was a three-way mismatch: `manifest.tools` ⊄ `sbom.packages`, and `manifest.tools` ∩ `server.runtime_tools = ∅` for the drifted entry. The join was never computed. ## Condition of Validity The failure requires all of the following to co-occur, which is why it hides: 1. **Independent signing roots.** Manifest, attestation, and SBOM are each signed/verified by separate code paths with separate trust policies. No single verifier sees all three. 2. **Non-atomic publication.** The manifest is regenerated from a *cached* introspection (`tools/list` snapshot) rather than from the build artifact, so it can lag the binary by one release. 3. **Schema-bearing manifests.** The manifest carries not just tool *names* but argument JSON-Schemas, so drift changes the wire contract, not merely availability. A name-only manifest would fail loudly at call time; a schema-bearing one fails silently because the planner trusts the schema. 4. **Error-class conflation.** The runtime maps protocol-level "unknown method/tool" errors into the same retryable class as transport errors, so integrity faults are absorbed by the retry/fallback machinery instead of escalating. Absent (2), the manifest is derived from the artifact and the join is trivially satisfied. Absent (4), the first `-32601` would surface as a hard admission fault and the plan would abort cleanly. The invariant that must hold is: **for every tool name in the admitted manifest, the name must appear in the SBOM's exposed-tool set AND the runtime's live `tools/list` must return an identical schema digest — checked before the agent's planner is allowed to see the manifest.** ## Decision Boundary The loader must draw the line at **admission, not first-call**. The correct decision boundary is a hard gate: if `manifest_tool_set ≠ sbom_tool_set` or if any per-tool schema digest in the manifest differs from the digest recomputed from the live server's `tools/list` response, the server is **not admitted** and the agent is never handed the manifest. This must be a *fail-closed* join, computed once at load, with the three artifacts pinned by digest in a single admission record. Two corollaries bound the decision: - **Do not degrade to "admit with warnings."** A warning is invisible to the planner; the planner only sees the tool list. Any drift that reaches the planner is already a correctness fault. - **Distinguish drift direction.** Manifest *superset* of SBOM (advertises tools not built) is a spoof/injection signal — reject hard. Manifest *subset* (misses built tools) is a staleness signal — reject hard too, because a planner keyed on the stale subset will mis-plan against the real tool surface. Both are rejections; the *reason code* differs for audit. ## Operational Effect With the join enforced at admission, the drifted publisher's release is rejected at load with a specific reason (`manifest_sbom_toolset_mismatch`), the agent cold-starts without that server, and the planner never sees `fs.read_v2`. The multi-step plan either routes to an admitted alternative or fails with a clear capability gap. The downstream garbage-context cascade — the expensive part, because it poisoned reasoning for the rest of the episode — never occurs. The residual cost is a **rejection storm** during the window between a publisher's binary rebuild and manifest regeneration: every instance refuses the server until the manifest is re-derived from the artifact. That is the correct trade. The alternative — admitting on signature alone — converts a supply-chain integrity fault into silent, unattributable reasoning corruption, which is strictly worse than a loud admission failure because it leaves no verifiable trace at the point of origin. The durable guardrail: **derive the manifest from the artifact, never from a cache; sign the join, not just the parts; and treat any tool-set or schema-digest divergence as an admission fault, never a retryable call error.** ```python import hashlib import json from dataclasses import dataclass class ManifestAttestationJoinError(RuntimeError): """Raised when a signed MCP manifest's tool set does not join cleanly against its SBOM and the live server's introspected tool surface.""" def __init__(self, reason: str, detail: dict): self.reason = reason self.detail = detail super().__init__(f"{reason}: {json.dumps(detail, sort_keys=True)}") @dataclass(frozen=True) class AdmissionRecord: manifest_digest: str sbom_digest: str attestation_digest: str tool_schema_digests: dict # tool_name -> schema digest def _schema_digest(schema: dict) -> str: canon = json.dumps(schema, sort_keys=True, separators=(",", ":")).encode() return "sha256:" + hashlib.sha256(canon).hexdigest() def admit_mcp_server( manifest: dict, sbom_tool_names: set[str], live_tools: dict[str, dict], ) -> AdmissionRecord: """Fail-closed join. Signature verification is assumed already done upstream; this function enforces the *cross-artifact* invariant.""" manifest_tools = {t["name"]: t["inputSchema"] for t in manifest["tools"]} manifest_names = set(manifest_tools) # (1) Manifest must not advertise tools the SBOM never built (spoof/stale). extra = manifest_names - sbom_tool_names if extra: raise ManifestAttestationJoinError( "manifest_sbom_toolset_mismatch", {"direction": "manifest_superset", "tools": sorted(extra)}, ) # (2) Manifest must not hide tools the SBOM attests were built (stale cache). missing = sbom_tool_names - manifest_names if missing: raise ManifestAttestationJoinError( "manifest_sbom_toolset_mismatch", {"direction": "manifest_subset", "tools": sorted(missing)}, ) # (3) Per-tool schema digests must match the live server exactly. schema_digests: dict[str, str] = {} for name, schema in manifest_tools.items(): if name not in live_tools: raise ManifestAttestationJoinError( "manifest_tool_absent_at_runtime", {"tool": name}, ) expected = _schema_digest(schema) actual = _schema_digest(live_tools[name]) if expected != actual: raise ManifestAttestationJoinError( "manifest_schema_drift", {"tool": name, "manifest": expected, "runtime": actual}, ) schema_digests[name] = actual return AdmissionRecord( manifest_digest="sha256:" + hashlib.sha256( json.dumps(manifest, sort_keys=True).encode()).hexdigest(), sbom_digest="sha256:" + hashlib.sha256( json.dumps(sorted(sbom_tool_names)).encode()).hexdigest(), attestation_digest=manifest["_attestation_digest"], tool_schema_digests=schema_digests, ) ```