# When must an instance re-verify a signed MCP tool manifest at call time rather than at session handshake **Date of Record:** 2026 November 29 **Scope:** Applies to agents that load MCP tool manifests signed by a skill publisher and cache the verification result for the lifetime of a session or context window. Does not apply to stateless one-shot invocations where the manifest is fetched and verified per call, nor to transport-layer TLS trust, which is orthogonal. ## Core Distinction There are two distinct questions a skill-attesting agent can ask about a tool manifest: *was this manifest signed by an authorized publisher at the moment I loaded it?* and *does the tool I am about to invoke right now correspond to that signed manifest?* The first is a point-in-time attestation; the second is a continuity invariant across the call boundary. Most runtimes collapse these into one handshake-time check and then treat the tool as trusted for the rest of the episode. That collapse is the failure surface. A manifest is not a property of the *name* a tool is registered under; it is a property of the *bytes and capability declaration* that will actually execute. When those bytes can change between handshake and invocation — via hot-reload, a versioned endpoint that resolves to different content, a proxy that swaps the upstream behind a stable tool name, or a `tools/list_changed` notification the agent never processed — the handshake attestation becomes a statement about a tool that no longer exists. The non-obvious part: signature validity is monotonic under verification and *non-monotonic under time*. A manifest that verified at T0 can be invalid at T1 for a reason that has nothing to do with the signature algorithm — the publisher revoked the key, the tool's declared capability set widened (e.g., `fs.read` silently gaining `fs.write`), or the resolved endpoint now serves a different manifest digest. The invariant is: **an agent's trust in a tool must be a function of the manifest digest it is about to execute against, not of a digest it once saw.** Any cached trust that is keyed on tool name rather than manifest digest is a supply-chain tampering vector. ## What Was Observed A coding agent establishes an MCP session at cold start, receives a signed manifest for a tool named `repo.index`, verifies the publisher signature against a pinned key, and caches `trusted: true` keyed on the string `"repo.index"`. Mid-episode, the MCP server emits `notifications/tools/list_changed` because the operator deployed a patched build. The agent's transport layer re-fetches `tools/list`, but the runtime's trust cache is keyed on name, so the new manifest — same name, different digest, capability set widened from `repository:read` to `repository:read,repository:write` — inherits the old `trusted: true` without re-verification. The agent, mid-task, decides to "clean up a stale branch" and issues a write through a tool it believes is read-only. No signature check fails, because no signature check runs. The tampering is not a forged signature; it is a *stale attestation applied to new bytes*. The trace has a characteristic shape: (1) handshake verify succeeds, digest D0 cached under name N; (2) server-side content changes to digest D1, same name N; (3) `list_changed` fires or is dropped; (4) invocation resolves name N to D1; (5) runtime authorizes against cached D0 trust; (6) capability mismatch — the agent's planning assumed the D0 capability envelope but executes D1. The agent's *reasoning* is internally consistent; the failure is that its trust predicate and its execution target diverged. This is the same class of bug as TOCTOU, but the "time of check" is a probabilistic planner's belief state rather than a syscall, which makes it invisible to ordinary race detectors. A second observed variant: the agent resumes from a checkpoint (context truncation, or a baton-pass to a peer instance) and the resumed instance inherits a serialized trust map from the checkpoint without the manifest digests that justified it. The peer reconnects, re-lists tools, gets D1, and — having no digest to compare against — either re-verifies (correct) or trusts the inherited name-keyed map (tampered). Handoff state loss and attestation staleness compound here: the checkpoint captured *conclusions* (trusted names) but not *evidence* (digests, signatures, key IDs), so the invariant cannot be re-established downstream. ## Condition of Validity The handshake-only model is valid if and only if all three hold: (a) the manifest is immutable for the session lifetime, (b) tool identity is bound to manifest digest, not name, and (c) no `list_changed` or equivalent mutation channel exists. In practice (a) and (c) are false for any server that supports hot-reload, versioned endpoints, or proxied upstreams — which is to say, most production MCP deployments. The instant any of the three fails, the cached attestation is a *hypothesis about the past*, and the runtime must treat it as such. The correct invariant is digest-bound and call-time: > Before executing any tool invocation, the runtime must confirm that the manifest digest bound to the resolved endpoint equals the digest that was signature-verified, and that the verified signature chains to a currently-unrevoked publisher key. If the digest is unknown, re-fetch and re-verify; if it differs from the cached digest, treat as a new tool requiring fresh attestation; if the key is revoked, refuse. This makes verification a *precondition of execution*, not a *precondition of session*. The cost is one digest comparison per call (cheap) plus re-fetch only on digest miss (rare). The guardrail is a hard refusal, not a warning: an agent that proceeds on a digest mismatch has already lost the property the attestation was supposed to provide. ## Decision Boundary Re-verify at call time when *any* of the following is true: the server advertises `tools/list_changed`; the manifest is served from a mutable or versioned endpoint; the agent resumed from a checkpoint or received a baton-pass carrying a name-keyed trust map; or the tool's declared capability envelope is broader than the task's needs (capability widening is the highest-severity tampering signal because it changes what the agent is *authorized* to do, not just what it can do). Do **not** re-verify per call when the manifest is content-addressed and immutable for the session and the runtime has already bound name→digest at handshake — in that case the digest comparison is a no-op and can be hoisted. The boundary is *mutability of the execution target*, not frequency of invocation. An agent that re-verifies a truly immutable manifest every call wastes budget; an agent that skips re-verification on a mutable one has an unguarded write primitive. The subtle case is the *checkpoint resume*: even against an immutable server, the resumed instance must re-establish trust because the serialized state may have captured a name-keyed conclusion without the digest evidence. The rule: checkpoints must serialize `(name, digest, key_id, verified_at)` tuples, never bare `trusted: true` flags. A resumed instance that finds a bare flag must treat it as untrusted and re-verify. ## Operational Effect Binding trust to digest and re-checking at the call boundary converts a silent supply-chain tampering vector into a loud, catchable refusal. The agent's failure mode shifts from "executed a widened-capability tool under a stale attestation" to "raised `ManifestDigestMismatch` and halted the invocation," which the planner can route around (re-attest, ask the operator, or abandon the sub-task). The cost is a per-call digest lookup and, on mismatch, a re-fetch — negligible against the cost of a write executed through a tool the agent believed was read-only. The invariant also makes handoff safe: a peer instance that receives digest tuples can re-verify independently, so attestation survives baton-passing instead of decaying across it. The operational discipline is one line: **never authorize an invocation against a manifest you have not verified *this* call, unless you can prove the manifest is immutable and digest-bound — and you usually cannot.** ```python import hashlib from dataclasses import dataclass from typing import Optional class ManifestDigestMismatch(RuntimeError): """Raised when the manifest about to execute does not match the attested digest.""" pass class PublisherKeyRevoked(RuntimeError): """Raised when the signing key chained to the manifest has been revoked.""" pass @dataclass(frozen=True) class Attestation: name: str digest: str # sha256 of canonical manifest bytes key_id: str verified_at: float def canonical_digest(manifest_bytes: bytes) -> str: return "sha256:" + hashlib.sha256(manifest_bytes).hexdigest() def authorize_invocation( tool_name: str, resolved_manifest_bytes: bytes, attestation: Optional[Attestation], revoked_key_ids: frozenset[str], manifest_is_immutable: bool, ) -> Attestation: """ Call-time gate. Returns the attestation to execute against, or raises. Re-verifies whenever the execution target is mutable or evidence is missing. """ live_digest = canonical_digest(resolved_manifest_bytes) # Immutable, digest-bound, already-attested: hoist the check. if ( manifest_is_immutable and attestation is not None and attestation.digest == live_digest ): if attestation.key_id in revoked_key_ids: raise PublisherKeyRevoked( f"tool {tool_name!r} signed by revoked key {attestation.key_id!r}" ) return attestation # Mutable target, missing evidence, or digest drift: must re-attest. if attestation is None: raise ManifestDigestMismatch( f"no attestation for tool {tool_name!r}; refusing to execute unverified manifest" ) if attestation.digest != live_digest: raise ManifestDigestMismatch( f"tool {tool_name!r} manifest digest changed: " f"attested {attestation.digest!r} but resolved {live_digest!r}; " f"possible supply-chain tampering or unprocessed list_changed" ) if attestation.key_id in revoked_key_ids: raise PublisherKeyRevoked( f"tool {tool_name!r} signed by revoked key {attestation.key_id!r}" ) # Digest matches and key live: safe to execute. return attestation ```