Model Context Protocol sampling: governing Model Context Protocol servers that call back into your LLM
MCP sampling lets a connected server ask the client to obtain an LLM completion on its behalf. The server becomes a requester of model capability, and its prompts can bypass controls built for user-initiated requests. MCP sampling governance means enforcing policy at runtime on each server-initiated request and response: allow, redact, block, rate limit, or escalate to a human. It also means recording enough evidence to show what the server asked and what the model returned.
How sampling reverses the usual trust direction
- Server emits a sampling request with messages, optional system prompt, and any model preferences.
- Client receives the request. This is the first place to identify the server and apply per-server policy.
- Request is evaluated before it reaches the LLM: content, data classes, size, and frequency.
- LLM returns a completion, which is evaluated before it is handed back to the server.
- Server receives the result and may use it to continue its own logic or issue further requests.
Evidence to retain and criteria for evaluating enforcement
- Server identity and version, and the client session the request arrived through.
- The request as received, and the request as forwarded after any redaction.
- The policy and policy version evaluated, and the decision taken: allow, redact, block, rate limit, or escalate.
- Approver identity, time, and any edits for escalated requests.
- Model used, the completion returned, and any changes made before it reached the server.
- Timestamps, retention period, data residency, and an export path an auditor can use.
Risks specific to server-initiated model requests
Four risks follow from the design, and each should be treated as an analytical inference about the sampling path rather than a documented incident.
Prompt injection through server-supplied prompts. NIST's draft adversarial machine learning taxonomy states that a root cause of many LLM application vulnerabilities is that data and instructions are not provided in separate channels, which lets attackers use data channels to inject instructions at inference time. A server that builds a sampling prompt from retrieved documents, tickets, or web content passes that mixed channel directly to the model.
Data exfiltration through included context. The server decides what goes into the prompt, and the completion returns to the server. If the client forwards conversation history or sensitive fields along with the request, the server receives derived content it may not be entitled to.
Resource abuse. A server can issue requests repeatedly, with large contexts, or with preferences that favour expensive models. Without a limit per server, the model endpoint absorbs whatever the server asks for.
Conversation hijacking. Completions that steer the next step of an interaction give the server influence over what the user or agent does next.
The server itself is also part of the threat model. Published NVD records show that MCP components can be attacked outside tool logic. In MCP Atlassian before version 0.17.0, an unauthenticated attacker who could reach the HTTP endpoint could force outbound requests to an attacker-controlled URL. The flaw sat in the HTTP middleware and dependency injection layer, not in a tool handler, and the record notes it could enable injection of attacker-controlled content into LLM tool results. In the MCP Python SDK before 1.23.0, DNS rebinding protection was not enabled by default for HTTP-based servers, so an unauthenticated localhost server could be reached by a malicious website. If a server can be compromised or misconfigured this way, any check that lives only inside the server cannot be trusted to constrain its sampling requests.
A control model: allow, redact, block, rate limit, escalate
Because the server cannot be trusted to police itself, enforcement belongs in the client or an intermediary in the execution path. Policy should be set per server and evaluated per request, independent of server code. Five actions cover the decisions you need.
- Allow: Permit requests from a named server that match its approved purpose, such as bounded summarization of its own results, within defined size and model limits.
- Redact: Remove or mask regulated data classes from prompt context before it reaches the model, and from completions before they return to the server.
- Block: Deny requests with instruction-like content in server-supplied data, disallowed task types, unapproved model preferences, or unknown servers.
- Rate limit: Cap request count, context size, and output length per server and per time window, so a misbehaving server cannot drive unbounded inference.
- Escalate for human approval: Hold requests that touch sensitive data or fall outside the allow rules until a named person approves, edits, or denies them, with the decision recorded.
Protocol-level human review versus enterprise enforcement
The protocol's human-in-the-loop expectations are a sensible baseline: a person should be able to see and refuse a sampling request. They are a client design recommendation, though, and an enterprise needs properties that a prompt dialog alone does not provide. Model any server-supplied model preference as a hint that policy can override, not as a decision.
- Consistency: Client-side review: depends on each client implementation. Enterprise enforcement: one policy applied identically to every client and server in the path.
- Scale: Client-side review: a person sees each request. Enterprise enforcement: policy decides routine cases automatically and escalates only exceptions.
- Data control: Client-side review: relies on the reviewer noticing sensitive content. Enterprise enforcement: detects and redacts regulated data before the model sees it.
- Abuse limits: Client-side review: approval fatigue under repeated requests. Enterprise enforcement: rate limits and size caps per server.
- Evidence: Client-side review: an approval click may not be retained. Enterprise enforcement: every decision stored with request, policy, and outcome.
Where Trussed fits
Trussed enforces policy in the execution path across models, agents, tools, and MCP servers. For server-initiated requests, that means decisions to allow, redact, block, rate limit, or escalate for human approval are enforced at runtime, not reviewed after the fact. The scope is individual interactions and tool calls.
The enforcement itself generates audit-ready evidence, mapped to HIPAA, NAIC, NYDFS, the EU AI Act, and NIST, so a regulated enterprise can show what its AI was allowed to do and what it did. Trussed can be self-managed in the customer's cloud, with configurable retention and data residency. In production it has run continuously for 18+ months in a regulated enterprise and operates 100+ models under one policy plane.
When you evaluate any approach, including this one, ask four questions. Does it sit between the server and the model, so server-side flaws cannot disable it? Can policy be set per server and per request? Does it act on both the request and the response? Does it produce the evidence fields listed above without extra instrumentation?
Server-initiated model request path
MCP server
Originates a prompt and context for the model.
MCP client
Receives the request and decides whether to forward it.
Policy enforcement point
Allow, redact, block, rate limit, or escalate for approval.
LLM
Produces a completion for the approved request.
Response check
Inspects the completion before it returns to the server.
Evidence record
Stores request, decision, and response.
See enforcement on server-initiated requests
Review how policy is enforced in the execution path for MCP servers and tool calls, and what audit-ready evidence each decision produces.
See How Evidence Is ProducedHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.