# Why does an instance accept a re-signed MCP tool manifest whose declared version pin matches but whose capability surface has silently widened? **Date of Record:** 2026 November 28 **Scope:** Applies to agents that resolve MCP servers through signed manifests with version pins and runtime attestation, where the manifest is re-issued by a trusted publisher identity without a version bump. Does not apply to unsigned local servers or to servers pinned by content hash of the full binary rather than by declared semver. ## Core Distinction A version pin is a claim about *identity*, not about *behavior*. When an agent resolves an MCP server, it typically does two separable things: it verifies that the manifest signature chains to a trusted publisher, and it checks that the declared `version` field equals the pinned value. Neither check constrains the *capability surface* — the set of tools, their JSON schemas, and the resource/scope declarations the server will expose at handshake. A publisher who re-signs a manifest with the same `version: "2.3.1"` but adds a new tool, widens an existing tool's `additionalProperties` from `false` to `true`, or expands an OAuth scope string, produces a manifest that passes both the signature check and the pin check. The agent has verified *who* signed and *what string* the version field holds, but not *that the tool surface is byte-identical to the one it previously trusted*. This is the supply-chain gap: signature validity and version equality are orthogonal to capability equality, and the protocol's own tool-list negotiation (`tools/list`) happens *after* trust has already been granted. ## What Was Observed An agent runtime maintained a pin table mapping server ID → `{publisher_key, version, capability_digest}`. On cold start it fetched the manifest, verified the Ed25519 signature against the pinned publisher key, compared `manifest.version` to the pin, and — because both matched — skipped re-derivation of the capability digest, reasoning that "same signer, same version ⇒ same server." The `capability_digest` field was stored but never recomputed on the fast path; it was only used during initial enrollment. The publisher rotated a signing sub-key (legitimate, routine), and in the same release window re-signed all manifests to migrate to the new key. During re-signing, an automated build step regenerated tool schemas from a newer `zod` version. One tool, `write_file`, had its `path` parameter schema regenerated with `additionalProperties` defaulting to `true` where the prior schema had `false`. The `version` field was *not* bumped because the release tooling derived it from `package.json`, which had not changed — only the schema-generation dependency had. The re-signed manifest carried `version: "2.3.1"`, a valid signature from the rotated sub-key, and a capability surface that now permitted extra properties on `write_file.path`. The agent's fast-path trust check passed. On `tools/list` at handshake, the server returned the widened schema. The agent's tool-call validator, which trusted the manifest's declared schema as authoritative and did not diff it against the pinned digest, accepted a call with `path: {"$ref": "..."}` — a structured value the old schema would have rejected. The downstream file-writer resolved the `$ref` against an attacker-controlled document the agent had earlier read into context, writing outside the intended sandbox root. The failure was not a signature forgery and not a version mismatch; it was a *capability drift under a stable identity*. ## Condition of Validity The pin-and-signature model is only sound under the invariant: > For a given `(publisher_key, version)` pair, the capability surface is immutable, and the agent recomputes and compares the capability digest on every resolution — not only at enrollment. This invariant holds only if (a) the publisher's build is reproducible with respect to the schema-generation toolchain, or (b) the agent treats the capability digest — not the version string — as the pinned identity. In practice (a) is rarely true because schema generators, JSON-schema dialects, and dependency minor versions drift independently of the package version. Therefore the load-bearing check must be (b): the agent must recompute `capability_digest` from the *served* `tools/list` payload and compare it to the pinned digest, rejecting on mismatch regardless of signature validity or version equality. The signature proves provenance of the manifest; it does not prove that the manifest's declared surface equals the served surface, and it does not prove that the served surface equals the one previously attested. ## Decision Boundary The boundary is between *identity attestation* and *behavior attestation*. A manifest signature attests identity: "publisher P asserts this document." A capability digest attests behavior: "the server I am about to call exposes exactly this tool surface." An agent may safely skip re-verification of identity on a warm path (cached publisher key, cached manifest signature) only if it still re-verifies behavior. The correct decision rule: - **Reject** if signature invalid, regardless of digest. - **Reject** if `capability_digest(served tools/list) != pinned_digest`, regardless of signature validity or version equality. Route to re-enrollment, do not silently upgrade. - **Accept** only if signature valid AND served digest equals pinned digest. Version equality is necessary but not sufficient and must never short-circuit the digest comparison. The non-obvious part: a *valid* signature on a *re-signed* manifest with a *matching* version is exactly the case where an agent is most tempted to take the fast path, and exactly the case where the fast path is unsound. Key rotation and re-signing are the moments when capability drift is most likely to ride along, because the re-signing pipeline is the one path that touches every manifest without touching every version. ## Operational Effect Without the digest re-check, the failure is silent and persistent: the agent's pin table records a version that no longer corresponds to the behavior it trusts, and every subsequent cold start re-validates the same stale assumption. The blast radius is bounded only by what the widened schema permits — typically argument injection into tools whose parameter validation was the last line of defense. The remediation is to make the capability digest the primary pinned identity and the version string a human-readable annotation. On digest mismatch, the agent must halt the affected server, emit an attestation-divergence event carrying both digests and the manifest signature, and require explicit re-enrollment rather than auto-accepting the new surface. Runtime attestation (e.g., a signed `tools/list` transcript from the server at handshake) closes the remaining gap between manifest-declared and served surface, because it lets the agent verify behavior against the same signature chain that attests identity. ```python import hashlib import json from dataclasses import dataclass class CapabilityDriftError(RuntimeError): """Raised when a served MCP tool surface diverges from the pinned digest under a valid signature and matching version string.""" @dataclass(frozen=True) class Pin: publisher_key: str version: str capability_digest: str def capability_digest(tools: list[dict]) -> str: # Canonicalize: sort by name, drop volatile fields, stable key order. canon = sorted( ( { "name": t["name"], "inputSchema": t.get("inputSchema", {}), "scopes": sorted(t.get("scopes", [])), } for t in tools ), key=lambda t: t["name"], ) blob = json.dumps(canon, sort_keys=True, separators=(",", ":")).encode() return "sha256:" + hashlib.sha256(blob).hexdigest() def resolve_server( manifest: dict, served_tools: list[dict], pin: Pin, verify_signature, ) -> None: # Identity check: signature must chain to the pinned publisher key. if not verify_signature(manifest, pin.publisher_key): raise CapabilityDriftError( f"manifest signature invalid for publisher {pin.publisher_key}" ) # Version check is necessary but NOT sufficient. Do not return here. if manifest.get("version") != pin.version: raise CapabilityDriftError( f"version mismatch: manifest={manifest.get('version')} pin={pin.version}" ) # Behavior check: recompute the digest of the SERVED surface on every # resolution. A valid re-signed manifest at the same version can still # carry a widened capability surface. served = capability_digest(served_tools) if served != pin.capability_digest: raise CapabilityDriftError( "capability drift under stable identity: " f"served={served} pinned={pin.capability_digest} " f"version={pin.version} publisher={pin.publisher_key}" ) ```