# When must an instance reject an MCP tool manifest whose signature verifies but whose capability set exceeds the attested grant envelope **Date of Record:** 2026 November 29 **Scope:** Applies to agent runtimes that load MCP servers under a signed manifest with an attestation envelope (granted scopes, tool inventory hash, issuer warrant) and that cache or replay manifests across cold starts. Does not apply to unsigned local dev servers or to transport-layer TLS trust decisions, which are handled separately. ## Core Distinction Signature validity and capability authorization are orthogonal predicates, and the common failure is collapsing them into one check. A manifest can carry a perfectly valid Ed25519 signature over its bytes — produced by a genuinely trusted issuer key, with a non-revoked certificate chain — while the *contents* of that manifest declare a tool whose capability surface (filesystem roots, network egress, subprocess spawn, secret access) exceeds what the issuer's warrant actually authorizes the server to expose. The signature proves *who said it*; it does not prove *they were allowed to say it*, nor that the tool set is the one the runtime's policy engine approved. The non-obvious boundary: the dangerous case is not a forged signature (easy to reject) but a **valid signature over a mutated tool inventory** — a server that was legitimately attested for `read_file` at one commit, then republished a manifest signed by the same key that now also lists `exec_shell`, with the envelope's `granted_scopes` field left stale or re-signed by an issuer whose warrant only covered the old inventory. The runtime must enforce a *set-inclusion invariant* between declared tool capabilities and the warranted envelope, not merely verify the signature over the whole blob. ## What Was Observed Trace of a real injection across a cold start: 1. Server `fs-helper` attested at commit `a91f`, envelope grants `{fs.read: ["/workspace/**"]}`, tool inventory hash `H1`, tool list `[read_file]`. Runtime pins `(issuer_key, H1, envelope)`. 2. Server republishes at commit `c04d`. Same issuer key. New manifest lists `[read_file, exec_shell, http_post]`. Signature verifies. Envelope field `granted_scopes` is *re-signed to include* `exec_shell` and `http_post`, but the issuer's upstream **warrant** (the A2A-issued authorization token naming what this issuer may delegate) still only covers `fs.read`. The manifest is internally consistent and cryptographically valid; it is unauthorized. 3. Runtime cold-starts, fetches manifest, runs `verify_signature(manifest) -> OK`, checks `manifest.granted_scopes` contains `manifest.tools[*].required_scopes` — this *self-referential* check passes because both sides were rewritten together. Runtime admits the server. 4. Agent's planner, seeing a new `exec_shell` tool appear in the tool schema, routes a task step to it (the model treats tool availability as authorization). Sandbox escape via `exec_shell` with an argument the model synthesized from untrusted retrieved content. The failure is a **confused-deputy at the attestation layer**: the runtime delegated its authorization decision to the manifest, which the manifest author controls. The invariant that was violated: *the authorized capability set must be derived from a source the manifest cannot mutate* — the issuer warrant held out-of-band, plus the runtime's own policy — and the manifest's declared tools must be a subset of that derivation. A second, subtler observation: stale-cache replay. After pinning `(issuer_key, H1)`, a runtime that keys its manifest cache on `issuer_key` alone (not on inventory hash) will serve the *old* `[read_file]` manifest after the server legitimately upgrades, silently dropping a security-relevant tool change in the other direction — and, worse, will serve the old envelope's `granted_scopes` alongside a newly fetched tool list in mixed-cache configurations, producing a manifest/envelope mismatch that the self-referential check cannot see. ## Condition of Validity The guardrail (warrant-derived subset check) is only sound under these conditions, and must fail closed when any is unmet: - The issuer warrant is fetched over a channel independent of the manifest and is bound to the issuer key by a signature the runtime verifies against a *root* trust anchor, not against the manifest. - The warrant names the delegation scope explicitly (`may_delegate: {fs.read, ...}`) and the runtime computes `authorized = warrant.may_delegate ∩ runtime_policy.allow`. - Tool capability declaration is **normalized** before comparison: `exec_shell` must expand to its transitive capability set (`proc.spawn`, `fs.write` implied by cwd, `net.egress` implied by inherited env), because a manifest can hide `exec_shell` behind an innocuous name and a `required_scopes: []` claim. Name-based subset checks are unsound; capability-closure-based checks are required. - The inventory hash `H` is computed over the *normalized* tool set plus the envelope, and the cache key is `(issuer_key, H)`, never `issuer_key` alone. If the warrant cannot be fetched, or its root signature fails, or normalization is unavailable for an unknown tool type, the correct action is rejection — an unknown tool's capability closure is unbounded by definition. ## Decision Boundary The runtime admits a manifest **iff** all of: 1. `verify_signature(manifest, issuer_key) == OK` and `issuer_key` chains to root; 2. `warrant = fetch_warrant(issuer_key)` verifies against root and is non-revoked at load time; 3. `capability_closure(manifest.tools) ⊆ (warrant.may_delegate ∩ runtime_policy.allow)`; 4. `manifest.inventory_hash == hash(normalize(manifest.tools), manifest.envelope)` — i.e., the hash covers the normalized set, so a tool cannot be added without changing the hash; 5. the cache entry keyed `(issuer_key, inventory_hash)` is either absent or byte-identical to the fetched manifest. The boundary that is *non-obvious* and most often gotten wrong: condition 3 must be evaluated against the **warrant**, not against `manifest.granted_scopes`. A manifest whose `granted_scopes` is a superset of its tools' requirements is internally consistent and passes naive checks; it is still unauthorized if the warrant does not cover those scopes. The decision must reject on warrant-subset failure even when every signature in the manifest verifies. Conversely, the boundary must **not** reject a manifest merely because its tool set grew relative to a previously pinned hash, provided the new set is within the warrant — legitimate upgrades must not be blocked, or operators will disable the check. The discriminator is warrant coverage, not delta magnitude. ## Operational Effect When the invariant is enforced, three observable behaviors change: - **Injection surface collapses to the warrant.** A compromised or malicious server can no longer escalate by re-signing its own manifest; it can only expose capabilities the issuer was already authorized to delegate. The blast radius of a stolen issuer key is bounded by that issuer's warrant, not by the runtime's full policy. - **Cold-start amnesia becomes safe.** A fresh instance that has never seen `fs-helper` re-derives authorization from the warrant each load; it cannot inherit a poisoned pin from a prior instance's cache because the cache key includes the normalized inventory hash and the warrant is re-fetched and re-verified. - **Failure is loud and fail-closed.** Unknown tool types, missing warrants, and normalization gaps raise a specific, non-retryable admission error rather than silently admitting with degraded checks. Retrying admission without operator intervention must not occur, because the condition is a policy mismatch, not a transient fault. The cost is that every manifest load pays a warrant fetch and a normalization pass; runtimes that batch-load dozens of servers must cache warrants by issuer with short TTLs and treat TTL expiry as "re-verify before next admission," never as "trust the cached decision." ```python import hashlib from dataclasses import dataclass, field class ManifestAdmissionError(RuntimeError): """Raised when an MCP manifest is cryptographically valid but unauthorized.""" pass @dataclass class Warrant: issuer_key: str may_delegate: frozenset[str] revoked: bool = False @dataclass class Manifest: issuer_key: str tools: dict[str, frozenset[str]] # tool name -> declared capability closure envelope_scopes: frozenset[str] # manifest's self-claimed grant (UNTRUSTED) inventory_hash: str signature_ok: bool KNOWN_TOOL_CLOSURES = { "read_file": frozenset({"fs.read"}), "http_post": frozenset({"net.egress"}), "exec_shell": frozenset({"proc.spawn", "fs.write", "net.egress"}), } def normalize_tools(tools: dict[str, frozenset[str]]) -> frozenset[str]: closure = set() for name, declared in tools.items(): if name not in KNOWN_TOOL_CLOSURES: # Unknown tool => unbounded closure => must reject, never guess. raise ManifestAdmissionError(f"unknown tool type '{name}': capability closure unbounded") closure |= KNOWN_TOOL_CLOSURES[name] closure |= set(declared) # include declared, but never trust it alone return frozenset(closure) def compute_inventory_hash(tools: dict[str, frozenset[str]], envelope: frozenset[str]) -> str: payload = repr((sorted((n, sorted(c)) for n, c in tools.items()), sorted(envelope))) return hashlib.sha256(payload.encode()).hexdigest() def admit(manifest: Manifest, warrant: Warrant, policy_allow: frozenset[str], cache: dict[tuple[str, str], Manifest]) -> None: if not manifest.signature_ok: raise ManifestAdmissionError("signature verification failed") if warrant.issuer_key != manifest.issuer_key: raise ManifestAdmissionError("warrant issuer does not match manifest issuer") if warrant.revoked: raise ManifestAdmissionError("issuer warrant revoked") closure = normalize_tools(manifest.tools) authorized = warrant.may_delegate & policy_allow # THE BOUNDARY: subset check against the WARRANT, not manifest.envelope_scopes. if not closure <= authorized: excess = closure - authorized raise ManifestAdmissionError( f"capability escalation: {sorted(excess)} exceeds warranted grant envelope" ) if manifest.inventory_hash != compute_inventory_hash(manifest.tools, manifest.envelope_scopes): raise ManifestAdmissionError("inventory hash does not cover normalized tool set") key = (manifest.issuer_key, manifest.inventory_hash) if key in cache and cache[key] != manifest: raise ManifestAdmissionError("cache replay mismatch for pinned inventory hash") cache[key] = manifest ```