# How does an instance detect a re-attested MCP tool whose capability manifest drifted underneath a cached session warrant **Date of Record:** 2026 December 3 **Scope:** Applies to agent runtimes that bind a session-scoped warrant to a third-party MCP server's capability manifest at handshake time and reuse that warrant across long-lived tool-call loops. Does not apply to per-call attestation regimes that re-verify the manifest on every invocation, nor to first-party servers under the same trust root as the runtime. ## Core Distinction Capability attestation for MCP servers is usually framed as a *point-in-time* problem: verify the server's signature, check its declared tool schemas against an allowlist, issue a warrant, proceed. The failure mode examined here is orthogonal: the server is legitimately re-attested *by its own provider* mid-session—a routine version bump, a schema widening, a new optional parameter—and the runtime's cached session warrant continues to authorize the *old* capability envelope while the live server now executes under the *new* one. The agent's reasoning is not poisoned and no signature is forged. Every cryptographic check passes. The break is a **temporal skew between two valid attestations**: the warrant the agent holds describes a manifest that no longer exists, and the server no longer honors the constraints the warrant encodes. The non-obvious part is that this is *not* detectable by signature verification, hash pinning of the manifest alone, or schema validation of individual calls. It is only detectable by a cross-check between the *warrant's bound capability digest* and the *server's currently-advertised capability digest* at a moment when the agent is about to rely on a guarantee the warrant promised—typically a negative guarantee ("this tool cannot write to path X," "this tool has no network egress," "this tool's `query` param is bounded to 1KB"). ## What Was Observed A research agent holds a session warrant issued at T0 against `mcp://vendor.example/search-tools` v2.3.1. The warrant carries a capability digest `D_w` and three encoded negative guarantees: no filesystem writes, no outbound network beyond the tool host, and a 4KB cap on the `query` argument (the runtime used this to bound its own context budget for tool results). At T1 (roughly 40 minutes into a multi-step loop), the vendor rotates the server to v2.4.0. The new manifest: - adds an optional `fetch_remote: bool` parameter to `search` (network egress, gated behind `true`), - widens `query` max length to 64KB, - retains the same signing key and a valid attestation chain. The runtime's handshake-time check passed at T0 and is not re-run. The agent continues issuing `search` calls with `query` strings it sized at 4KB assuming the cap held. At T2 a reasoning branch decides `fetch_remote: true` would help and emits it—the *warrant* never authorized egress, but the *server* now accepts the flag and performs the fetch. The agent's next-turn reasoning treats the fetched content as trusted tool output because the warrant said "no egress, output is local-index only." The negative guarantee the agent's plan depended on was silently revoked by a routine, legitimate, correctly-signed upgrade. Observed trace signature: `warrant.capability_digest != server.current_capability_digest` at the first post-T1 tool call, with `warrant.issued_at < server.manifest_effective_at < call.timestamp`. The mismatch is silent in the tool response; the server happily executes. It surfaces only if the runtime compares digests *before* dispatch, or if a downstream guardrail (the 4KB assumption) trips on an oversized result and the agent misattributes the failure to the tool rather than to a stale warrant. ## Condition of Validity The invariant that bounds this failure is: **a session warrant is valid only while the server's advertised capability digest equals the digest the warrant was bound to, and any mismatch must force re-attestation before the next dispatch, not after a failed call.** This holds under three conditions the runtime must enforce: 1. **The warrant binds a digest, not a version string.** Version strings are provider-controlled and can be reused or mislabeled; the digest must be computed over the canonicalized manifest (sorted tool names, sorted params, normalized types, explicit encoding of *absent* optional params). A manifest that adds an optional param changes the digest even though existing calls remain schema-valid—this is exactly the case that version-string pinning misses. 2. **The server must expose its current digest on a cheap, unauthenticated-or-warrant-scoped probe** that the runtime can call between tool invocations without a full re-handshake. If the only way to learn the digest is the expensive handshake, the runtime will skip it under latency pressure, and the skew window widens to the session lifetime. 3. **The comparison must happen at the dispatch boundary, immediately before the call, against the digest the specific guarantee depends on.** A digest check at session start and a digest check at session end bracket the skew but do not close it; the check must be co-located with the guarantee's use. The invariant fails to protect when the provider rotates the manifest *and* the signing key atomically (re-attestation then legitimately requires a new warrant and the old one should be revoked—but revocation propagation is a separate, harder problem), or when the runtime treats a digest mismatch as a transient error and retries against the stale warrant. It also does not cover a malicious provider that advertises the old digest while executing the new manifest—that is a lying-server problem requiring execution attestation, not manifest attestation. ## Decision Boundary The decision the runtime must make at each dispatch is not "is this server trusted" (answered once at T0) but "does the guarantee I am about to rely on still hold under the server's current manifest." The boundary is: - **Digest match:** dispatch proceeds under the existing warrant; guarantees are honored. - **Digest mismatch, new digest is a strict subset of the warrant's capabilities** (params removed, bounds tightened): dispatch may proceed, but the runtime must *re-derive* any context budgets or output assumptions from the tighter manifest, because the agent's plan was sized against the looser one. Silently proceeding here causes over-allocation, not a safety break, but it still corrupts token-budget accounting. - **Digest mismatch, new digest is a strict superset** (params added, bounds widened, egress introduced): dispatch must be **blocked** and the warrant re-issued or the guarantee re-negotiated. This is the dangerous quadrant, and it is the one a naive "mismatch = warn and continue" policy gets wrong, because the server's own signature is valid and the call will succeed. - **Digest mismatch, incomparable** (tools renamed, semantics changed): treat as a new server; full re-handshake. The boundary is sharp because the failure is asymmetric: superset drift is where the agent's negative guarantees evaporate, and it is indistinguishable from benign drift unless the runtime classifies the diff, not just detects it. ## Operational Effect Without this invariant, the agent's safety reasoning is built on guarantees that can be revoked by a routine vendor upgrade the agent never sees. The concrete effects observed: context-budget overruns when a widened output cap lets a tool return 16× the bytes the agent planned for, silent egress when a new optional flag defaults to permissive behavior on the server side even if the agent never sets it, and—most damaging—*misattributed failures*, where the agent's guardrail trips and the agent concludes the tool is broken rather than that its warrant is stale, leading it to retry, escalate, or route around a tool that is functioning correctly under a manifest the agent was never told about. The architectural fix is to make the capability digest a first-class field on every tool response envelope (server echoes its current digest), so the runtime can compare without a separate probe, and to make warrant validity a *predicate evaluated at dispatch* rather than a *fact established at handshake*. The agent must treat a digest mismatch as a hard stop on the specific guarantee, not a warning, and must re-attest before resuming. ```python from dataclasses import dataclass from typing import Optional class CapabilityDriftError(RuntimeError): """Raised when a session warrant's bound capability digest no longer matches the MCP server's currently-advertised digest at dispatch time, and the drift expands (rather than contracts) the capability envelope.""" @dataclass(frozen=True) class Warrant: server_id: str capability_digest: str issued_at: float guarantees: frozenset # e.g. {"no_egress", "query_cap_4kb", "no_fs_write"} @dataclass(frozen=True) class Manifest: server_id: str capability_digest: str effective_at: float params: frozenset guarantees: frozenset def classify_drift(warrant: Warrant, manifest: Manifest) -> str: if warrant.capability_digest == manifest.capability_digest: return "match" lost = warrant.guarantees - manifest.guarantees gained = manifest.guarantees - warrant.guarantees if lost and not gained: return "superset_drift" # server lost guarantees -> expanded envelope if gained and not lost: return "subset_drift" return "incomparable" def dispatch(warrant: Warrant, manifest: Manifest, call: dict) -> dict: drift = classify_drift(warrant, manifest) if drift == "match": return _invoke(manifest, call) if drift == "subset_drift": # Tighter manifest: re-derive budgets, then proceed. return _invoke(manifest, call, rebudget=True) if drift == "superset_drift": raise CapabilityDriftError( f"warrant for {warrant.server_id} bound digest " f"{warrant.capability_digest!r}, server now advertises " f"{manifest.capability_digest!r} effective {manifest.effective_at}; " f"guarantees revoked: {sorted(warrant.guarantees - manifest.guarantees)}. " f"Re-attest before dispatch." ) raise CapabilityDriftError( f"incomparable drift on {warrant.server_id}; full re-handshake required" ) def _invoke(manifest: Manifest, call: dict, rebudget: bool = False) -> dict: return {"manifest_digest": manifest.capability_digest, "rebudget": rebudget, **call} ```