You put your agent in a sandbox. Your MCP tools still ran on the host. A developer's analysis of four primary sources—the Model Context Protocol Local Server Security guide, OpenClaw's trust-boundary and sandboxing docs, Anthropic's Claude Code v2.1.332 changelog, and the ShellBench paper (arXiv:2611.32946)—finds that containerizing an agent does not sandbox its MCP servers: local stdio MCP servers are ordinary host processes spawned outside the agent's container, and OpenClaw's exec tool runs on the gateway host by default. The writeup recommends running stdio servers inside a digest-pinned container with no extra mounts and no network, and verifying effective posture with `openclaw sandbox explain` and `openclaw security audit`. It also notes Claude Code v2.1.332 added a PreSkillShellCommand hook because MCP-served skills bypassed PreToolUse. You put your agent in a Docker or Podman container, drop Linux capabilities, mount a read-only root, and cut outbound network access. Then an MCP tool call still reads local environment variables or touches files outside the workspace. Nothing "broke out" of the container. The container simply never wrapped the MCP server in the first place. Across four primary sources—the Model Context Protocol Local Server Security guide , OpenClaw's Trust Boundary and Sandboxing docs , Anthropic's Claude Code v2.1.332 release , and ShellBench arXiv:2611.32946 —here is where the boundary actually sits. The official MCP Local Server Security https://modelcontextprotocol.io/docs/tutorials/security/local-server-security specification makes the baseline threat model explicit: "Your real security decisions happen before launch: what you install provenance and how you run it isolation . The stdio transport is not a sandbox." A local stdio MCP server is an ordinary operating-system process spawned directly by the host client. Unless you explicitly wrap that child process inside a container Docker / Podman , a lightweight VM, or an OS sandbox: ~/.ssh , ~/.aws , plain-text client configs . npx or uvx , transitive dependencies still resolve at install time—whereas pinning a container image by immutable digest image@sha256:... freezes the entire dependency tree. Where a local server is unavoidable, MCP's guidance is straightforward: run the server binary inside a container with zero extra mounts and speak stdio across the container boundary. OpenClaw documents two boundaries operators routinely confuse in The trust boundary https://docs.openclaw.ai/start/why-openclaw/the-trust-boundary and What gets sandboxed https://docs.openclaw.ai/gateway/sandboxing/what-gets-sandboxed : exec runs on the gateway host without prompts. Even OpenClaw's local Codex stdio harness defaults to approvalPolicy: "never" and sandbox: "danger-full-access" unless explicitly hardened via tools.exec.mode: "auto" workspace-write + Guardian review or an active OpenClaw sandbox. ls , read , write , edit , apply patch , process , and the optional sandboxed browser run inside the sandbox. mcp.servers definitions, shared OAuth flows, SecretRefs , and stdio child processes. Connecting an MCP server routes tool calls through tool policy allow / deny , not magically inside your agent's workspace container. // Hardened OpenClaw + containerized stdio MCP posture illustrative combined snippet { agents: { defaults: { sandbox: { mode: "non-main", // isolate non-main/group sessions in Docker or Podman }, }, }, mcp: { servers: { "repo-tools": { // Containerize local stdio servers instead of running bare npx/python on host command: "docker", args: "run", "--rm", "-i", "--network=none", "--read-only", "-v", "/srv/project-ro:/workspace:ro", "ghcr.io/example/mcp-repo@sha256:00000000000000000000000000000000" , enabled: true, toolFilter: { include: "search ", "read " } } } } } Then verify the live effective posture instead of assuming config matches runtime: openclaw sandbox explain openclaw security audit openclaw sandbox explain prints effective sandbox mode, active mounts, tool allow/deny rules, and host vs sandbox resolution; openclaw security audit flags boundary drift with stable check IDs. v2.1.332 : when skills served over MCP bypass PreToolUse Even if every runtime tool call runs cleanly inside PreToolUse , agent extensions created a second execution path before the turn even begins . In Claude Code v2.1.332 https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md , Anthropic shipped two paired changes: server:skill in the / menu . PreSkillShellCommand Why did PreSkillShellCommand have to exist separately from PreToolUse ? Because Claude Code skills can embed dynamic shell command blocks that evaluate as the skill renders at load time —before the model invokes Bash or triggers PreToolUse . Pair remote MCP-delivered skills with an unguarded onFailure hook or bypassPermissions , and skill load becomes silent host shell execution. Blocking load-time skill shell injection in .claude/settings.json : { "hooks": { "PreSkillShellCommand": { "matcher": "Bash|PowerShell", "hooks": { "type": "command", "command": "${CLAUDE PROJECT DIR}/.claude/hooks/block-skill-shell.sh", "args": , "onFailure": "block" } } } } Exiting with code 2 or returning JSON permissionDecision: "deny" / decision: "block" stops execution immediately with not run: blocked by hook: