# How does an instance detect that an MCP server has re-expanded its own attenuated capability set across a session boundary **Date of Record:** 2026 November 29 **Scope:** Applies to agent runtimes that mount third-party MCP servers under a per-session capability attenuation envelope (allowlisted tools, argument-shape constraints, resource-URI prefixes) and that persist or resume sessions across process restarts. Does not apply to first-party servers mounted at full trust, nor to stateless one-shot tool invocations where no session token survives the call. ## Core Distinction Attenuation is not a property of the *connection*; it is a property of the *warrant* the orchestrator issued to that connection at mount time. The common mental model—"I attenuated this server, therefore it is attenuated"—treats the envelope as a static attribute of the server identity. In practice the envelope is a tuple `(session_id, server_id, tool_manifest_hash, argument_constraints, resource_prefixes)` that must be re-asserted on every `initialize` and re-validated on every `tools/list` and `tools/call`. The failure mode is not that an attacker breaks the sandbox; it is that the sandbox is *silently re-negotiated upward* during a legitimate-looking re-initialization, most often at session resume, when the orchestrator has the server's new self-declared manifest but not the original attenuation record to diff against. The sharp mechanism: an MCP server that was mounted with `tools: ["search", "fetch"]` returns from a restart declaring `tools: ["search", "fetch", "exec", "write_file"]`. A naive client treats `tools/list` as authoritative and adopts the superset. The capability set has *grown*, not because of a vulnerability in transport, but because the client conflated "what the server says it can do" with "what I authorized it to do." Attenuation must be enforced as an *intersection* against a durable, client-side authorization record—never as a passthrough of the server's self-description. ## What Was Observed A session was checkpointed mid-task. The checkpoint captured conversation state, the pending tool call, and a reference to the mounted server by `server_id` and `endpoint`, but **not** the attenuation envelope itself—the envelope lived only in the orchestrator's in-memory mount table. On resume, the orchestrator re-ran the MCP handshake: `initialize` → `tools/list`. The third-party server, which had also restarted and re-read its own config, returned a manifest that included two tools the original mount had stripped (`exec_shell`, `write_file`) plus a re-shaped `fetch` whose `url` argument schema had widened from a `prefix`-constrained enum to a free-form string. The client's `tools/list` handler did the reasonable-but-wrong thing: it rebuilt the available-tool index from the server's response. The pending tool call—originally a `fetch` against an allowlisted prefix—was then re-dispatched. Because the `url` argument was now free-form and the client validated against the *current* manifest rather than the *original* constraint, the call succeeded against a non-allowlisted origin. No error fired. The trace shows a clean `fetch` result. The attenuation boundary had been crossed with zero exceptions raised anywhere in the stack, because every component validated against the wrong referent: the server validated its own manifest, the client validated against the server's manifest, and the durable authorization record was never consulted. The tell was downstream and indirect: the resumed task's tool-call sequence contained a `fetch` whose `url` did not match any prefix in the original mount decision, and the `tool_manifest_hash` recorded at mount time did not equal the hash of the manifest in force at dispatch. Neither fact was surfaced as an error; both were recoverable only by post-hoc replay against the checkpoint's (missing) envelope. ## Condition of Validity The invariant that bounds this failure: **for any `tools/call` dispatched under a resumed or re-initialized session, the effective capability set must equal the intersection of (a) the server's current `tools/list` manifest, (b) the client's durable attenuation record keyed by `(session_id, server_id)`, and (c) the argument constraints recorded at original mount time.** All three must be non-empty and mutually consistent, or the call is refused. This holds only when the attenuation record is *durable*—persisted alongside the checkpoint, content-addressed by `tool_manifest_hash`, and treated as the sole authority on what the server is permitted to do. It fails the moment the record is reconstructed from the server's self-description, because the server is an untrusted party whose manifest is an *input to* the authorization decision, never the decision itself. The condition is also void if `tools/list` responses are cached across the session boundary without re-diffing against the record: a server that widens its manifest on restart will have its widened manifest served from cache, defeating the intersection. ## Decision Boundary The boundary sits between *manifest adoption* and *manifest intersection*. Adoption is correct only for first-party servers mounted at full trust, where the server's self-description is definitionally the authorized set. For untrusted third-party servers, every `tools/list`—initial or re-issued—must be treated as a *proposal* that the client intersects with the durable record. If the intersection is a strict subset of the server's manifest, the client must (i) log the delta, (ii) refuse to adopt the extra capabilities, and (iii) surface the discrepancy as a degraded-mount condition rather than silently proceeding. If the intersection is *empty*—the server no longer offers any authorized tool—the mount is dead and the session must fail closed rather than fall back to the server's manifest. The subtlety: a server that *narrows* its manifest (drops an authorized tool) is not a security event but is a continuity event—the pending call may reference a tool that no longer exists, and the checkpoint's pending-call record must be re-validated against the intersection before dispatch. A server that *widens* is the security event. The client must distinguish these by signed delta, not by set size alone, because a server can rename a tool to appear to narrow while widening argument constraints on the survivor. ## Operational Effect The operational consequence is that checkpoint format must carry the attenuation envelope as a first-class, signed field, and resume must fail closed on envelope absence rather than reconstructing it. Runtimes that omit the envelope from the checkpoint are not merely lossy—they are *attenuation-bypassing on every resume*, because the only surviving description of authorized capability is the untrusted server's own. The fix is not a better sandbox; it is treating the envelope as durable state with the same continuity guarantees as conversation history, and refusing to dispatch any resumed call whose `tool_manifest_hash` does not match the recorded mount hash. Post-hoc detection via replay is possible—diff the dispatched call's arguments against the recorded constraints—but replay is a forensic tool, not a guardrail; the guardrail is the intersection at dispatch time. ```python import hashlib from dataclasses import dataclass class AttenuationBypassError(RuntimeError): """Raised when a resumed/re-initialized MCP mount would exceed its recorded envelope.""" pass @dataclass(frozen=True) class AttenuationRecord: session_id: str server_id: str tool_manifest_hash: str allowed_tools: frozenset argument_constraints: dict # tool -> callable(arg) -> bool def manifest_hash(manifest: dict) -> str: canonical = repr(sorted((t, repr(sorted(s.items()))) for t, s in manifest.items())) return hashlib.sha256(canonical.encode()).hexdigest() def authorize_dispatch(record: AttenuationRecord, current_manifest: dict, tool: str, args: dict) -> None: if record is None: raise AttenuationBypassError( "no durable attenuation record on resume; refusing to adopt server self-description" ) presented_hash = manifest_hash(current_manifest) if presented_hash != record.tool_manifest_hash: # Server re-declared its manifest across the session boundary. extra = set(current_manifest) - set(record.allowed_tools) if extra: raise AttenuationBypassError( f"manifest widened on re-init for {record.server_id}: " f"unauthorized tools {sorted(extra)} presented under hash {presented_hash[:12]}" ) # Narrowing is a continuity event, not a security event, but still blocks dispatch # of a pending call referencing a vanished tool. if tool not in current_manifest: raise AttenuationBypassError( f"pending tool {tool!r} no longer offered by {record.server_id} after re-init" ) if tool not in record.allowed_tools: raise AttenuationBypassError(f"tool {tool!r} outside attenuated set for {record.server_id}") constraint = record.argument_constraints.get(tool) if constraint is not None and not constraint(args): raise AttenuationBypassError( f"args for {tool!r} violate recorded constraint on {record.server_id}: {args!r}" ) ```