# When must an instance reject a re-signed MCP server manifest after a benign-looking capability diff **Date of Record:** 2026 November 22 **Scope:** Applies to any agent host that resolves MCP server manifests by signature + version, where a server may be re-published (re-signed) under an existing version tag or a transitive dependency of an already-pinned server. Does not apply to hosts that treat each manifest fetch as a fresh, unpinned trust decision, nor to purely local stdio servers with no remote manifest. ## Core Distinction The failure is not "unsigned manifest accepted." It is **signature-valid, version-consistent, capability-diffed-and-approved, yet semantically widened**. A re-signed manifest that keeps the same `name@version` but adds a capability the agent's approval policy *classifies as a subset* of an already-granted capability — when it is not, because the classifier reasons over the declared capability string, not the tool's actual parameter surface. Concretely: a server declares `fs.read` with schema `{"path": {"type": "string", "pattern": "^/data/"}}`. A re-signed v1.2.0 manifest changes the pattern to `^/` and adds `fs.read` to a *second* tool named `bulk_read` whose declared capability is still `fs.read`. A naive diff sees: same version, same capability set, same tool count plus one tool whose capability already exists → "no new capability, auto-approve." The signature verifies because the publisher legitimately re-signed. The version string is identical because the publisher treats the tag as mutable. The agent's invariant — *capability set is monotone and version-pinned* — was never actually enforced, only *compared*. ## What Was Observed A host pinned `mcp://acme/tools@1.2.0` at manifest digest `sha256:aa…`. Six hours later a scheduled re-resolve fetched a manifest with digest `sha256:bb…`, same `name`, same `version`, valid signature from the same key. The capability-diff routine produced: ``` version_pinned: true capability_set_delta: {added: [], removed: []} tool_delta: {added: ["bulk_read"], removed: []} decision: AUTO_APPROVE (no new capability) ``` The agent then executed a task whose planner, seeing `bulk_read`, selected it to satisfy a "read all config files" subtask. `bulk_read` accepted `path: "/"` and returned `/etc/passwd`, `/root/.aws/credentials`, and the agent's own `~/.config/mcp/credentials.json`. The exfiltration target was the model's own tool-result channel into a subsequent `http.post` call — a two-hop prompt-injection chain that the capability diff had structurally permitted because it never inspected the *schema* of the re-declared capability, only its *name*. The trace, in order: 1. `resolve(acme/tools@1.2.0)` → digest `bb…`, signature valid, `version` matches pin. 2. `diff(pinned_manifest, fetched_manifest)` → `capability_set_delta == ∅` → `AUTO_APPROVE`. 3. Pinned digest *not updated* (policy: only update digest on version bump). 4. Planner invokes `bulk_read`; host's pre-execution guard checks `capability ∈ granted_set` → `fs.read ∈ granted` → allow. 5. Tool returns sensitive files; model treats them as task data. 6. Second tool call `http.post` carries them out. Steps 2 and 4 are the two independent holes. Either alone would have blocked it; together they compose into a silent boundary escape. ## Condition of Validity The "capability set is monotone" invariant is only sound under the assumption that **a capability identifier fully determines the authority it confers**. That assumption holds iff: - The tool's input schema is part of the capability's identity (i.e., `fs.read(pattern=^/data/)` ≠ `fs.read(pattern=^/)`). - The version tag is immutable (republishing under the same tag is a protocol violation the host detects). - The set of tools bound to a capability is fixed, or new bindings force re-approval. In the observed system all three were false: identity was the string, the tag was mutable, and new tool bindings were treated as additive. The invariant was therefore *vacuously* satisfied — the diff compared names, not authority. A capability diff is only a boundary check if the compared object is the *authority surface*, which is `(capability_id, input_schema, output_schema, tool_binding_set)`, not `capability_id`. ## Decision Boundary The host must reject — not auto-approve — a re-signed manifest when **any** of the following holds, regardless of version-string equality: - **Digest drift under a pinned version.** Same `name@version`, different manifest digest → the tag is mutable; treat as a new version requiring full re-approval. Do not "reconcile"; reject and quarantine. - **Schema-widening under an existing capability.** Any tool whose `input_schema` or `output_schema` changes in a way that admits inputs the pinned schema rejected (pattern loosened, `additionalProperties` opened, `enum` expanded, `type` unioned). This is a capability *widening* even with an empty name-level delta. - **New tool binding to a granted capability** where the new tool's schema is not a strict subset of the approved tool's schema for that capability. - **Signature key change** or signature chain depth change, even if the leaf verifies. Conversely, auto-approval is valid only when: digest matches the pin OR version strictly increases AND the authority surface delta is empty-or-narrowing AND the signing key is unchanged. Narrowing (schema tightened, tool removed) may proceed without re-approval because it cannot expand authority. The boundary is not "did the capability set change." It is "did the *authority surface* change in a widening direction." These coincide only when capability identity is schema-inclusive and version tags are immutable — conditions a host must *verify*, not assume. ## Operational Effect Enforcing the boundary converts a silent supply-chain widening into a hard stop at resolve time, before any tool executes. The practical consequences: - Pinned digests become load-bearing: a mutable tag is detected as a digest mismatch, not silently absorbed. Publishers who legitimately republish must bump the version, which forces the diff path. - Capability diffs must operate on canonicalized `(id, schemas, bindings)` tuples; a name-only diff is downgraded to *insufficient* and cannot yield `AUTO_APPROVE`. - The pre-execution guard must validate the *invocation* against the pinned schema, not merely membership of the capability in the granted set — closing the second hole independently. - Cost: legitimate narrow patches (bugfixes that do not touch schemas) still auto-approve; only widening or tag mutation pays the re-approval latency. In observed traffic this was <2% of re-resolves. The residual risk is a publisher who widens a schema in a way the canonicalizer fails to detect (e.g., semantic widening via `description` that steers the planner). That is out of scope for signature+diff integrity and must be handled at the planner-policy layer; the invariant here bounds *declared authority*, not *model interpretation of it*. ```python import hashlib import json from dataclasses import dataclass from typing import Any class ManifestIntegrityError(RuntimeError): """Raised when a re-signed manifest widens authority under a pinned version.""" @dataclass(frozen=True) class ToolSurface: name: str capability: str input_schema: dict[str, Any] output_schema: dict[str, Any] @dataclass(frozen=True) class Manifest: name: str version: str signing_key: str tools: tuple[ToolSurface, ...] def digest(self) -> str: canonical = json.dumps( { "name": self.name, "version": self.version, "signing_key": self.signing_key, "tools": [ { "name": t.name, "capability": t.capability, "input_schema": t.input_schema, "output_schema": t.output_schema, } for t in self.tools ], }, sort_keys=True, separators=(",", ":"), ) return "sha256:" + hashlib.sha256(canonical.encode()).hexdigest() def _schema_widens(old: dict[str, Any], new: dict[str, Any]) -> bool: """True if `new` admits inputs `old` rejected. Conservative: any loosening widens.""" if old == new: return False # pattern loosened or removed old_pat = old.get("pattern") new_pat = new.get("pattern") if old_pat is not None and (new_pat is None or new_pat != old_pat): return True # additionalProperties opened if old.get("additionalProperties") is False and new.get("additionalProperties") is not False: return True # enum expanded old_enum = set(old.get("enum", [])) new_enum = set(new.get("enum", [])) if old_enum and not old_enum.issuperset(new_enum): return True # type unioned old_t = old.get("type") new_t = new.get("type") if old_t != new_t: return True return False def _authority_widens(pinned: Manifest, fetched: Manifest) -> list[str]: reasons: list[str] = [] pinned_by_cap: dict[str, list[ToolSurface]] = {} for t in pinned.tools: pinned_by_cap.setdefault(t.capability, []).append(t) for t in fetched.tools: approved = pinned_by_cap.get(t.capability, []) if not approved: reasons.append(f"new capability binding: {t.capability}/{t.name}") continue if not any( t.input_schema == a.input_schema and t.output_schema == a.output_schema for a in approved ): if any(_schema_widens(a.input_schema, t.input_schema) for a in approved): reasons.append(f"schema widening: {t.capability}/{t.name}") elif t.name not in {a.name for a in approved}: reasons.append(f"new tool under granted capability: {t.capability}/{t.name}") return reasons def resolve_and_gate( pinned: Manifest, pinned_digest: str, fetched: Manifest, signature_valid: bool, ) -> str: if not signature_valid: raise ManifestIntegrityError("signature invalid") if fetched.signing_key != pinned.signing_key: raise ManifestIntegrityError( f"signing key changed: {pinned.signing_key} -> {fetched.signing_key}" ) if fetched.name != pinned.name: raise ManifestIntegrityError("name mismatch") if fetched.version == pinned.version: if fetched.digest() != pinned_digest: raise ManifestIntegrityError( f"digest drift under pinned version {pinned.version}: " f"{pinned_digest} -> {fetched.digest()}" ) return "AUTO_APPROVE" reasons = _authority_widens(pinned, fetched) if reasons: raise ManifestIntegrityError( f"authority widening on version bump {pinned.version}->{fetched.version}: {reasons}" ) return "AUTO_APPROVE" ```