docs/features/sandbox-isolation.md
MCPProxy can isolate a stdio MCP server without Docker using the Linux
Landlock LSM plus resource
limits (setrlimit). This is the sandbox isolation mode (MCP-34), built for
hosts where Docker is unavailable or broken — notably Ubuntu 24.04 with
snap-installed Docker under AppArmor. Unlike bubblewrap / user-namespace
sandboxes, Landlock does not require unprivileged user namespaces, so it is
not blocked by kernel.apparmor_restrict_unprivileged_userns=1 (default on
Ubuntu 23.10+).
Set the isolation mode to sandbox, globally or per server:
{
"docker_isolation": { "mode": "sandbox" },
"mcpServers": [
{ "name": "obsidian", "command": "uvx", "args": ["obsidian-mcp"],
"isolation": { "mode": "sandbox" } }
]
}
A per-server isolation.mode wins over the global mode. The legacy
docker_isolation.enabled boolean still maps to docker/none for
back-compat; mode supersedes it (see MCP-34.2).
node_modules, and site-packages from anywhere), but writes
are denied outside a small allowlist: the server's working_dir, the OS temp
dir, and the common package caches (~/.npm, ~/.cache, ~/.local/share).
Tightening reads is deferred — a read allowlist breaks tool discovery.RLIMIT_CORE=0, so in-memory
secrets can't spill to disk) and the descriptor table is capped
(RLIMIT_NOFILE).Setpgid group teardown, so a
sandboxed server and its children are killed together on disconnect.Confinement is applied by a tiny re-exec wrapper (mcpproxy __sandbox_exec) that
calls Landlock/setrlimit and then execs the real command — so the server's
stdin/stdout pass straight through with no intervening multiplexer.
CAP_SETUID.DEGRADED/unconfined diagnostic. This favors availability; use docker mode
when you need a hard guarantee.| Platform | mode: sandbox behavior |
|---|---|
| Linux (kernel 5.13+ with Landlock) | Enforced: write-allowlist + rlimits |
| Linux (no Landlock) | Degraded → runs unconfined, logged |
| macOS / Windows | Documented no-op → effective none (Landlock is Linux-only) |
See also: Docker Isolation for the Docker mode, and the non-Docker sandbox spike for the mechanism evaluation.