Defining Sandboxing in an MCP Context
The Model Context Protocol defines three roles: a host application that coordinates access, a client that maintains a one-to-one connection to a server, and a server that exposes tools, resources, or prompts. This architecture creates a trust boundary at the point where a host connects to a server, particularly when that server is third-party or community-published. Sandboxing refers to the technical controls that constrain what a server can do once that connection is established: what processes it can run, what files or network endpoints it can reach, and what data it can access beyond the specific tool call it was invoked for.
It is important to be precise about what MCP itself provides. The specification requires user consent before a host exposes a server's capabilities to a model, and it defines an OAuth 2.1-based authorization framework for HTTP transports. Neither of these is sandboxing. Consent is a permission gate at the decision layer. OAuth scoping is an authorization control at the access layer. Sandboxing is a containment control at the execution layer, and the MCP specification explicitly states that it does not mandate a specific security model, leaving access control, validation, and isolation to implementors.
Where Sandboxing Fits in MCP Architecture
Coordinates model access and consent decisions.
Maintains a 1:1 connection to a single server.
Executes tools and returns data; treated as untrusted by default.
OS or network isolation layered around the server, outside protocol scope.
Why Isolation Is Necessary for Enterprise Deployments
The practical risk becomes clear when looking at how local MCP servers run. Servers invoked over the stdio transport execute with the same OS-level privileges as the host process, unless the deploying application explicitly isolates them. A local MCP server with a filesystem bug, a compromised dependency, or a malicious update inherits whatever access the host itself has. There is no protocol-level ceiling on that privilege.
Remote servers accessed over HTTP transports carry a different but related risk. They can be reached over the network and authorized through OAuth 2.1 tokens, but without network segmentation and scoped tokens, a compromised remote server can still act with broader access than a given tool call requires. Security research from the past year has documented tool poisoning, where a malicious or compromised server embeds hidden instructions in its own tool descriptions to manipulate the connected model, and confused-deputy scenarios, where a server with legitimate access is manipulated by untrusted input into acting outside its intended scope. Both risks assume the server itself, including its metadata, is a potentially untrusted input source, not only an untrusted execution environment.
How Sandboxing Interacts With MCP's Permission Model
MCP's built-in permission mechanisms are advisory rather than enforced. Tool annotations, such as read-only or destructive hints, are metadata supplied by the server itself. Anthropic's own MCP documentation states these annotations are not enforced by the protocol and should not be relied upon for security decisions. Consent workflows operate at the host UX layer and depend on the host vendor's implementation, which varies. None of this constitutes runtime enforcement.
Sandboxing is what turns a permission decision into a contained fact. When a host grants a server access to a tool, sandboxing determines what happens if that server attempts something outside the intended scope, whether through a bug, a compromised update, or a deliberately malicious tool description. The authorization layer decides what should be allowed. The sandbox decides what is actually possible. Enterprise deployments need both, because relying on the authorization layer alone assumes the server will behave as declared, which is precisely the assumption tool poisoning and confused-deputy attacks are designed to defeat.
Architectural controls for sandboxing MCP servers
Sandboxing an MCP server means combining several layers of containment rather than relying on any single control: OS-level process isolation for local (stdio) servers, network segmentation and scoped tokens for remote (HTTP) servers, and treating server-supplied metadata (tool descriptions and annotations) as untrusted input rather than authoritative instruction.
Implementation Considerations
Because the MCP specification leaves isolation to implementors, the practical burden falls on the deploying organization to decide how each transport type is contained. The distinctions below summarize the two primary cases discussed above.
| Transport | Default privilege | Primary risk | Containment control |
|---|---|---|---|
| stdio (local) | Inherits host process privileges | Filesystem bugs, compromised dependencies, malicious updates | OS-level process isolation |
| HTTP (remote) | Scoped by OAuth 2.1 token | Tool poisoning, confused-deputy behavior via network access | Network segmentation, scoped tokens |
Governance Beyond the Runtime Boundary
No MCP-specific regulatory standard currently mandates sandboxing. Organizations building enterprise AI agent deployments on MCP are largely mapping controls to existing frameworks, including OWASP's guidance on excessive agency and insecure plugin design in agentic applications, and general AI system security guidance from CISA and NSA recommending least-privilege access, sandboxing, and monitoring for AI systems that execute external tool calls.
A practical governance step is establishing an internal vetting process for third-party MCP servers, analogous to software supply-chain review, since these servers can execute arbitrary code and reach sensitive internal tools. Organizations should also define accountability for consent decisions explicitly, since the MCP specification places that responsibility on host implementations, which differ by vendor. Maintaining audit trails of tool invocations and authorization grants supports incident response and compliance reporting that the protocol does not provide natively.
Trussed AI's runtime governance capabilities, including agent identity, tool approval workflows, least-privilege permissioning, and independent audit logging, address this layer of MCP security: the runtime controls and governance discipline that sit around the protocol rather than inside it.