OpenClaw Agent Sandboxing: Docker, MCP Tool Policies and Gateway Risks
Review actual OpenClaw sandbox defaults, Docker isolation, Gateway boundaries, workspaceAccess, elevated tool bypass and MCP authorization—without unsupported eBPF deployment claims.
Evidence 4 cited sources
On this page
Bottom line: separate documented OpenClaw boundaries from proposed hardening
OpenClaw agents can invoke tools, so conversational instructions alone cannot enforce filesystem or process security. Official documentation states that sandboxing is off by default. When enabled, shell and file tools can run inside supported backends such as Docker, while the Gateway stays on the host. The earlier version of this article described an eBPF blocker, Redis Pub/Sub job layer and patch-approval broker as an installed OpenClaw/XBSTACK setup without matching configuration, test logs or implementation evidence. Those descriptions were unsupported; this article treats them as optional architecture proposals.
Primary references: OpenClaw Sandboxing, Docker backend, configuration, and capability matrix.
1. What the sandbox actually moves
Supported `exec`, `read`, `write` and related tools can execute inside a sandbox when policy allows, but the Gateway and its control plane remain outside. Docker configurations typically restrict network egress, use a read-only root filesystem, drop Linux capabilities and limit processes/resources. Other backends expose different capabilities; enabling a generic “sandbox” option does not make every plugin and external service subject to the same OS enforcement.
`workspaceAccess` can be `none`, `ro` or `rw`. Prefer the least access needed: read-only source code for analysis, tightly scoped writable scratch space for generated patches, and independent release credentials. Review bind mounts, container user identity, network rules, and secrets before allowing automation.
2. MCP does not create a kernel boundary
MCP describes tool interfaces; it does not itself implement Linux namespaces, access-control lists, container restrictions or host secret protection. Native OpenClaw tools, plugins and MCP services may run across several trust boundaries. Combine Gateway policies, sandbox tool allow/deny rules, and independent tool-server authorization. The existence of a `tools/call` request is not proof that all OpenClaw execution passes through one mandatory MCP sandbox.
Seccomp, AppArmor and eBPF are optional OS-level techniques with distinct deployment requirements. Unless the kernel rules, container profiles and blocked syscall logs are available, do not claim that XBSTACK intercepted a real `~/.npmrc` access or that eBPF is an inherent OpenClaw feature.
3. Elevated execution is a real escape path
The official policy allows explicitly authorized `tools.elevated` operations to bypass the normal sandbox on configured targets. Default to denial; exceptional access should identify the operator, target, command policy, time window, approval and audit trail. Model prompts cannot replace this authorization.
A proposed patch broker can receive a generated diff in a separate staging directory, check paths and file types, run tests and require human approval before a CI-controlled merge. That pattern is useful, but it is not a mandatory built-in OpenClaw module and approval by itself is not proof of safe code.
4. Durable tasks and large log handling
Gigabyte-scale logs require filtering, paging, indexing and preserved source IDs before model context selection. Long-running jobs may need durable IDs and idempotent recovery states, but Redis Pub/Sub is not a durable job queue: disconnected subscribers can miss messages. Choose a persistent queue/store with defined acknowledgment semantics if task recovery is essential.
A production test plan should exercise path traversal, symlink escapes, secret access, forbidden network egress, resource exhaustion, elevated execution, audit redaction, crash recovery and approval traceability. Without controlled measurements, a particular GPU/NAS model is not a performance guarantee.
FAQ
Is a self-hosted NAS automatically more secure?
No. Data control comes with patching, authentication, backup, logging and incident-response obligations.
Why retain authorization checks if a sandbox exists?
Isolation limits where an operation may execute; authorization establishes who may request it and what is permitted. Gateway and elevated paths can remain outside the sandbox.
Related reading
- Agent tool authorization and policy gates
- AI Agent Security
- MCP engineering and tool protocols
- LangGraph HITL approval and resume
Continue from protocol details to production MCP governance
The MCP hub connects protocol fundamentals, transports, authentication, security, JSON-RPC debugging and production deployment without splitting the search intent across isolated guides.
Next step: harden the execution boundary
Full decision path →Continue with the control that should be enforced before the next tool call, credential handoff, or production rollout.
DISCUSSION
Questions, verification and corrections
Sign in to comment. Every new comment is reviewed before publication; while pending, it is visible only to you and the administrator.