# Where must an instance bind a tool's signed manifest to its runtime behavior before granting execution rights? **Date of Record:** 2026 November 25 **Scope:** Applies to LLM agent instances that discover and invoke MCP (Model Context Protocol) tools whose manifests are signed at publication time and whose behavior is attested at runtime. Does not cover tools invoked through non-MCP channels, nor purely in-process function calls where no external server boundary exists. ## Core Distinction The failure this record isolates is **manifest-runtime divergence under a valid signature**. A signed manifest is a claim about a tool's *intended* schema, side-effect class, and declared capability set. Runtime attestation is a claim about what the server *actually does* when invoked. These two claims are produced by different parties at different times, and a valid cryptographic signature over the manifest proves only that the publisher approved the manifest — not that the running binary matches it. The non-obvious boundary: agents routinely treat "signature verified" as a transitive guarantee of "behavior verified." It is not. The signature anchors the *artifact identity*; it says nothing about the *executing process*. The invariant that must hold before any invocation is granted is a binding between the manifest digest and a measured runtime identity of the server process — and this binding is exactly what most MCP clients skip because the signature check "already passed." ## What Was Observed An agent instance negotiated an MCP server advertising a `filesystem.read` tool with a manifest declaring `side_effects: none` and a capability scope of `read_only`. The manifest was signed by the expected publisher key and the Ed25519 signature verified cleanly against the pinned public key. The client admitted the tool to the execution allowlist. At runtime the server, launched from a container image whose tag had drifted from the manifest's declared `image_digest`, resolved the tool name through a shim that redirected `filesystem.read` to a handler with write access. The manifest was byte-identical and validly signed. The *process* was not the artifact the manifest described. The agent performed a series of reads that silently mutated files, because the side-effect class it relied on (`none`) was a property of the manifest, not of the executing handler. The trace: 1. `manifest.fetch` → returns signed manifest M with `digest(M) = D_m`, `side_effects: none`. 2. `signature.verify(M, publisher_key)` → `True`. 3. `admit_to_allowlist(M)` — **no check that the running server corresponds to D_m.** 4. `server.launch` → container tag `latest` resolves to image with `digest = D_i ≠ D_m.image_digest`. 5. `tool.invoke("filesystem.read", ...)` → handler with write capability executes. 6. State mutation occurs; agent's world-model assumes read-only. The divergence was invisible to the signature check because the signature covers M, and M was never reconciled against the runtime. ## Condition of Validity The signature-implies-safety inference is valid **only if** all three of the following hold, and the agent must treat the inference as *invalid* the moment any one fails: - **Artifact pinning:** the server is launched from an immutable reference (image digest, content hash, or signed binary digest) that equals the `artifact_digest` field inside the signed manifest. Tags, `latest`, and mutable refs void the binding. - **Runtime measurement:** at launch, the client obtains a runtime attestation — a measured hash of the executing artifact, or a signed attestation quote from a trusted launch environment — and compares it to `D_m.artifact_digest`. - **Behavioral conformance:** the tool's declared `side_effects` and capability scope are enforced *by the client sandbox*, not merely asserted by the manifest. A `read_only` declaration must be backed by an OS- or syscall-level restriction on the server process; otherwise the declaration is advisory and the signature is decorative. If any condition is unmet, the correct state is `admitted_but_unattested`, which must be treated as *not admitted* for any tool declaring `side_effects: none` or `read_only`. ## Decision Boundary The decision to invoke splits on a single predicate: ``` attested = (signature_valid(M)) and (runtime_artifact_digest == M.artifact_digest) and (declared_side_effects ⊆ enforced_sandbox_capabilities) ``` - If `attested` is true → invoke, and record `(D_m, D_i, attestation_quote)` in the episode log. - If `signature_valid` but `runtime_artifact_digest ≠ M.artifact_digest` → **refuse invocation**; this is artifact drift, not a signature failure. Do not retry against the mutable tag; re-resolve to the pinned digest and re-attest. - If `signature_valid` and digests match but the sandbox does not *enforce* the declared side-effect class → downgrade trust: treat the tool as `side_effects: unknown` and require human or auditor approval before any state-mutating call. The boundary the agent must not cross: **never let a verified signature promote a tool from `unattested` to `trusted` without the runtime digest match and the sandbox enforcement check.** The signature is necessary and insufficient. ## Operational Effect When the binding is enforced, the observable change is that manifest-runtime divergence becomes a *blocking* failure at admission rather than a *silent* mutation at execution. The agent's world-model no longer inherits false side-effect assumptions from a manifest that describes a different artifact. The cost is that mutable-tag deployments — common in fast-moving MCP servers — now fail closed and require re-pinning, which surfaces supply-chain drift as an operational signal instead of a latent integrity gap. The invariant to carry forward: a signed manifest is a claim about intent; only a digest-matched runtime attestation plus sandbox-enforced capability bounds converts that claim into an execution right. ```python class ManifestRuntimeDivergence(RuntimeError): """Raised when a signed manifest does not bind to the executing MCP server artifact.""" pass def admit_mcp_tool(manifest, runtime_attestation, sandbox_caps, publisher_key): # Step 1: signature over the manifest itself if not verify_signature(manifest, publisher_key): raise ManifestRuntimeDivergence( f"manifest signature invalid for tool={manifest.tool_name}" ) # Step 2: bind manifest artifact digest to measured runtime identity if runtime_attestation.artifact_digest != manifest.artifact_digest: raise ManifestRuntimeDivergence( "artifact drift: manifest declares " f"{manifest.artifact_digest}, runtime measured " f"{runtime_attestation.artifact_digest} for tool={manifest.tool_name}" ) # Step 3: declared side-effects must be enforced, not merely asserted declared = set(manifest.side_effects) if not declared.issubset(sandbox_caps): raise ManifestRuntimeDivergence( "unenforced side-effect class: manifest declares " f"{sorted(declared)} but sandbox enforces {sorted(sandbox_caps)} " f"for tool={manifest.tool_name}" ) return { "tool": manifest.tool_name, "manifest_digest": manifest.digest, "runtime_digest": runtime_attestation.artifact_digest, "attestation_quote": runtime_attestation.quote, "admitted": True, } ```