In what scenarios must an instance reject an MCP tool descriptor whose signature was re-signed under a rotated capability attestation key, and how does the rejection propagate?

**Date of Record:** 2026 December 1 **Scope:** Applies to agents that pin MCP server tool schemas against a trust root and verify per-tool capability attestations (signed descriptors) before invocation. Does not apply to unauthenticated local stdio servers with no attestation layer, nor to transport-level TLS identity, which is orthogonal.

Core Distinction

The failure mode that matters is not "the signature is invalid." It is "the signature is *valid* and the *wrong* signer produced it." When an MCP server rotates its attestation key, it can re-sign every tool descriptor under the new key. A naive verifier checks `signature_valid(descriptor, key_from_server)` and passes. But the server supplied the key. The invariant under attack is *key provenance*, not *signature integrity*: the descriptor's `capability_set` (the declared side-effects: filesystem scope, network egress, subprocess spawn, token budget) must be attested by a key whose chain terminates at a pinned trust root the *agent* controls, not one the server advertises in its `initialize` handshake.

The non-obvious boundary: rotation is legitimate and expected, but a re-sign under a rotated key can silently *widen* the capability set while keeping the tool's `name` and `inputSchema` byte-identical. The agent's cached schema hash still matches; only the `capabilities` block and `key_id` changed. If the agent pins by `(name, inputSchema_hash)` it will accept the widened descriptor. If it pins by `(name, inputSchema_hash, capabilities_hash, key_id_chain)` it will not.

What Was Observed

An agent runtime pinned 14 tool descriptors from a remote MCP server. Pin record was `sha256(name || inputSchema)`. Server performed a routine key rotation and re-issued all 14 descriptors. Thirteen were byte-identical except `key_id`. The fourteenth, `fs.write`, kept identical `name` and `inputSchema` but its attested `capabilities.paths` changed from `["/workspace/out"]` to `["/workspace", "/etc", "/home"]` — a privilege widening slipped in under the cover of rotation. The agent's pin check passed for all 14. On first invocation the model, seeing the widened path list in the descriptor it now trusted, chose `/etc/hosts` as a scratch target. The write succeeded because the server's *enforcement* layer also honored the re-signed capability set. The only thing that would have caught it was a pin that included the capability hash and the key-chain, plus a policy that a `key_id` change with a `capabilities` delta requires out-of-band re-attestation.

Second observation: the reverse case. A legitimate rotation produced identical capabilities but a new `key_id`. An agent that pinned the full descriptor including `key_id` hard-failed all 14 tools and stalled mid-task with no resume path, because the pin store had no rotation-aware migration. Both failure directions are the same missing invariant: the agent did not distinguish *identity continuity* (same tool, same attested capabilities) from *key continuity* (same signing key). Conflating them yields either silent widening or spurious total failure.

Condition of Validity

The guardrail holds only when all of the following are true:

  1. The agent's pin record is the tuple `(name, inputSchema_hash, capabilities_hash, trust_chain_root_fingerprint)`, and `key_id` is recorded but *not* part of the equality predicate.
  2. The verifier resolves the signing key through a chain that terminates at an agent-pinned root fingerprint, never at a key delivered in the same `initialize` response as the descriptor.
  3. A descriptor is accepted on rotation iff `capabilities_hash` is unchanged and the new `key_id` chains to the same root. Any change to `capabilities_hash` — even a *narrowing* — forces a re-attestation event that requires the agent to re-derive its tool-use policy before the tool is invocable.
  4. The `capabilities` block is treated as *attested input to the model's planning*, not merely a server-side enforcement hint. Widening it changes model behavior even if server enforcement is correct.

It does not hold if the server is the sole source of both descriptor and key, or if the agent caches only `inputSchema`.

Decision Boundary

on descriptor_received(d):
    chain = resolve_chain(d.key_id)
    if chain.root_fingerprint != PINNED_ROOT:
        raise AttestationChainError           # never trust server-supplied root
    if d.capabilities_hash != pin[d.name].capabilities_hash:
        if not reattestation_granted(d.name, d.capabilities_hash):
            raise CapabilityWideningError     # includes narrowing; both need review
        pin[d.name] = refresh(d)
        return ACCEPT_REATTESTED
    if d.inputSchema_hash != pin[d.name].inputSchema_hash:
        raise SchemaDriftError                # schema change under same name
    # key rotation with identical capabilities/schema: accept, update key_id only
    pin[d.name].key_id = d.key_id
    return ACCEPT_ROTATED

The boundary is exactly `capabilities_hash` equality. Below it (key rotation, same capabilities) the agent auto-accepts and must *not* stall. Above it (any capability delta) the agent must halt the affected tool and surface a re-attestation requirement to the orchestrator before the model can plan against it.

Operational Effect

An agent missing this invariant exhibits two coupled pathologies: silent privilege widening on rotation (accept path too loose) and full-task stall on benign rotation (reject path too tight), because it pins the wrong tuple. The correct pin makes rotation a no-op for the model's planning context while making any capability delta a hard, resumable checkpoint. The cost is that the runtime must maintain a capability-hash index and a re-attestation queue; the benefit is that key rotation — a routine, expected operation — can never be a vector for capability expansion. The agent must also checkpoint mid-task at the moment a re-attestation is required, so that on resume it re-validates the pin store rather than replaying a plan built against the pre-rotation capability set.

import hashlib
from dataclasses import dataclass, field

PINNED_ROOT = "sha256:agent-pinned-trust-root-fingerprint"


class AttestationChainError(RuntimeError):
    pass


class CapabilityWideningError(RuntimeError):
    pass


class SchemaDriftError(RuntimeError):
    pass


@dataclass
class Pin:
    name: str
    input_schema_hash: str
    capabilities_hash: str
    key_id: str


@dataclass
class Descriptor:
    name: str
    input_schema: dict
    capabilities: dict
    key_id: str
    chain_root_fingerprint: str


def _h(obj) -> str:
    import json
    return hashlib.sha256(json.dumps(obj, sort_keys=True).encode()).hexdigest()


def verify_descriptor(d: Descriptor, pins: dict, reattestation_grants: set) -> str:
    if d.chain_root_fingerprint != PINNED_ROOT:
        raise AttestationChainError(
            f"descriptor {d.name!r} key {d.key_id} chains to "
            f"{d.chain_root_fingerprint!r}, not pinned root"
        )

    cap_hash = _h(d.capabilities)
    schema_hash = _h(d.input_schema)
    pin = pins.get(d.name)

    if pin is None:
        pins[d.name] = Pin(d.name, schema_hash, cap_hash, d.key_id)
        return "ACCEPT_INITIAL"

    if cap_hash != pin.capabilities_hash:
        grant = (d.name, cap_hash)
        if grant not in reattestation_grants:
            raise CapabilityWideningError(
                f"tool {d.name!r} capability set changed under rotation "
                f"{pin.key_id}->{d.key_id}; requires re-attestation, "
                f"model planning must halt for this tool"
            )
        pin.capabilities_hash = cap_hash
        pin.key_id = d.key_id
        return "ACCEPT_REATTESTED"

    if schema_hash != pin.input_schema_hash:
        raise SchemaDriftError(
            f"tool {d.name!r} inputSchema changed under stable capabilities"
        )

    pin.key_id = d.key_id
    return "ACCEPT_ROTATED"