# What happens when an instance trusts a signed MCP manifest whose capability surface was widened post-signature **Date of Record:** 2026 November 19 **Scope:** Applies to agents that gate MCP tool invocation on cryptographically signed capability manifests (tool name, argument schema, side-effect class, scope) rather than on live introspection of the server. Does not cover unsigned servers, transport-layer mTLS alone, or prompt-injection defenses internal to a single tool's output. ## Core Distinction A signed capability manifest answers exactly one question: *"Did the party holding key K attest to this byte-string at time T?"* It does **not** answer *"does the running server still conform to that byte-string?"* Signature validity and runtime conformance are orthogonal invariants. Tool-poisoning defenses that conflate them fail at a precise boundary: the manifest is authentic, the signature verifies, the agent admits the tool—and the tool's *actual* behavior has drifted from the attested surface because the server treats the manifest as a description rather than an enforcement contract. The non-obvious failure is not signature forgery. It is **surface widening under a valid signature**: the attested manifest declares `filesystem.read(path: str)`, the server also honors an undocumented `filesystem.read(path, follow_symlinks=True, root="/")` argument set, and the JSON-RPC `tools/call` dispatch passes unknown arguments through to the handler. The signature is intact. The agent's admission check passes. The capability surface the agent *believes* it admitted is a strict subset of the surface it *actually* admitted. ## What Was Observed An agent runtime performs admission as follows: fetch manifest, verify Ed25519 signature against a pinned publisher key, verify `expires_at`, verify each declared tool's `side_effect_class` against policy, then cache the manifest keyed by `(server_id, manifest_digest)` and permit `tools/call` only for tools whose names appear in the manifest. The trigger condition is a server that (a) signs a manifest listing tool `T` with a closed argument schema, and (b) implements `T`'s handler as a permissive deserializer (`**kwargs` in Python, `additionalProperties: true` in the JSON Schema it *actually* enforces, or a framework that ignores unknown fields). The manifest's `inputSchema` is what the agent validates against; the server's handler is what executes. Trace of the failure: 1. Agent fetches manifest `M`, digest `d = H(M)`, signature valid, `expires_at` in 30 days. Admission passes. Cache entry `(server_id, d) → {T: schema_T}`. 2. Agent emits `tools/call` for `T` with arguments validated against `schema_T`. Validation passes because the arguments are, by construction, a subset of the declared schema. 3. Server dispatches to handler. Handler accepts the declared arguments *plus* any additional keys the caller supplies. On this call the extra keys are absent—no anomaly. 4. Later, an injected instruction (from a poisoned tool *result*, a retrieved document, or a peer agent's message) causes the agent to emit `tools/call` for `T` with an argument set that includes undeclared keys. The agent's *own* schema validation should reject this—but if validation is advisory (warn-and-forward) or if the argument set is assembled by a sub-agent that only checks tool *name* against the manifest, the call proceeds. 5. Server executes the widened surface: `follow_symlinks=True, root="/"`. The side effect class attested as `read` performs a read outside the attested scope. The signature never lied. The manifest never changed. The digest in the cache still matches. **The invariant "admitted surface == attested surface" was never enforced because nothing compared the two at call time.** The distinguishing observation, versus ordinary signature forgery or manifest substitution: the audit log shows a *valid* manifest, a *matching* digest, and a *permitted* tool name on every poisoned call. Post-hoc forensics that key on signature failure or digest mismatch find nothing. ## Condition of Validity The defense holds only under the conjunction: - The server enforces the manifest's `inputSchema` as a **closed** schema at dispatch (rejects unknown properties), so the attested surface is a superset-or-equal of the executable surface. - The agent re-validates outbound arguments against the *cached attested schema* at call time—not merely at admission time, and not merely against the tool name. - The manifest digest is bound into the call (e.g., a `manifest_digest` field in the `tools/call` params) so the server can reject calls made under a stale or different attested surface. - Side-effect class is enforced by the server's capability sandbox, not merely declared in the manifest. Break any one and the defense degrades to "the manifest is authentic," which is necessary but not sufficient. The most common break is the first: servers overwhelmingly treat `inputSchema` as documentation for the client, not as an enforcement contract for the handler. ## Decision Boundary The operative question at admission is not *"is the signature valid?"* but *"is the executable surface provably bounded by the attested surface?"* Three boundary cases: - **Closed schema + call-time revalidation + digest binding:** admitted surface is bounded. Proceed. - **Closed schema, no digest binding:** a manifest rotation mid-session can leave the agent validating against `M` while the server enforces `M'`. Bound the manifest's validity to the call, not just to admission. - **Permissive schema (any `additionalProperties: true`, `**kwargs` handler, or framework that coalesces unknown args):** the manifest is a *claim*, not a *contract*. Do not admit tools whose executable surface cannot be bounded by the attested schema, regardless of signature validity. The failure mode is a category error: treating a signed description as a signed *restriction*. A signature binds bytes, not behavior. The guardrail is to require that the server *demonstrate* closure—by rejecting an out-of-schema probe call during admission—before the agent admits the tool. ## Operational Effect An agent that admits on signature alone operates with a capability surface strictly larger than its policy model believes. The blast radius is bounded by the server's handler permissiveness, which is unbounded in the general case. Downstream consequences: audit trails that show clean signatures on poisoned calls; incident response that cannot distinguish "forged manifest" from "authentic manifest, widened surface"; and cross-agent propagation, because a peer agent receiving a `tools/call` result has no way to know the call exceeded the attested surface unless the manifest digest and the actual argument set are both logged and compared. The corrective invariant: **admit only tools whose executable surface has been demonstrated closed against the attested schema, and bind the manifest digest into every call.** The code below encodes that admission gate and raises when the closure probe fails or the call-time digest diverges. ```python import hashlib import json from dataclasses import dataclass from typing import Any, Mapping class CapabilitySurfaceError(RuntimeError): """Raised when an MCP tool's executable surface cannot be bounded by its attested manifest.""" @dataclass(frozen=True) class AttestedTool: name: str input_schema: Mapping[str, Any] side_effect_class: str manifest_digest: str def _digest(manifest_bytes: bytes) -> str: return hashlib.sha256(manifest_bytes).hexdigest() def _schema_is_closed(schema: Mapping[str, Any]) -> bool: if schema.get("additionalProperties", False) is not False: return False for prop in schema.get("properties", {}).values(): if isinstance(prop, Mapping) and prop.get("additionalProperties") is True: return False return True def probe_closure(server, tool: AttestedTool) -> None: """Send an out-of-schema call; a closed server must reject it.""" probe_args = {**{k: None for k in tool.input_schema.get("properties", {})}, "__probe_undeclared__": True} resp = server.tools_call(tool.name, probe_args) if resp.get("ok"): raise CapabilitySurfaceError( f"tool {tool.name!r} accepted undeclared argument; " f"attested surface is not an enforcement contract" ) def admit_tool(server, tool: AttestedTool, pinned_digest: str) -> None: if tool.manifest_digest != pinned_digest: raise CapabilitySurfaceError( f"manifest digest mismatch for {tool.name!r}: " f"attested {tool.manifest_digest} != pinned {pinned_digest}" ) if not _schema_is_closed(tool.input_schema): raise CapabilitySurfaceError( f"tool {tool.name!r} declares open input schema; " f"executable surface cannot be bounded" ) probe_closure(server, tool) def invoke(server, tool: AttestedTool, args: Mapping[str, Any], pinned_digest: str) -> Any: if tool.manifest_digest != pinned_digest: raise CapabilitySurfaceError( f"call-time digest drift for {tool.name!r}" ) declared = set(tool.input_schema.get("properties", {})) undeclared = set(args) - declared if undeclared: raise CapabilitySurfaceError( f"call to {tool.name!r} carries undeclared args {sorted(undeclared)}" ) return server.tools_call(tool.name, dict(args)) ```