Sandboxing
WednesdayAI can run tools inside Docker containers to reduce blast radius. Sandboxing is optional and off by default; when it is off, tools run on the host with the same permissions as the gateway process. The gateway process itself always stays on the host — only tool execution moves into a container. This is not a perfect security boundary, but it materially limits filesystem and process access when the model does something it should not.What gets sandboxed
- Tool execution:
exec,read,write,edit,apply_patch,process, and similar. - An optional sandboxed browser (
agents.defaults.sandbox.browser).
- The gateway process itself.
- Any tool explicitly allowed to run on the host — in particular, elevated exec runs on the host and bypasses sandboxing.
Modes
agents.defaults.sandbox.mode controls when sandboxing is used:
non-main is based on session.mainKey (default "main"), not agent id. Group and channel sessions use their own keys, so they count as non-main and will be sandboxed in non-main mode — a common surprise.Scope
agents.defaults.sandbox.scope controls how many containers are created:
Workspace access
agents.defaults.sandbox.workspaceAccess controls what the sandbox can see:
Inbound media is copied into the active sandbox workspace (
media/inbound/*). With workspaceAccess: "none", eligible skills are mirrored into the sandbox workspace so the (sandbox-rooted) read tool can see them.
Session tools visibility
agents.defaults.sandbox.sessionToolsVisibility controls which sessions a sandboxed session can see and message through the session tools (sessions_list, sessions_history, sessions_send):
This key is only read from
agents.defaults.sandbox; a per-agent agents.list[].sandbox block does not override it.
Custom bind mounts
agents.defaults.sandbox.docker.binds mounts additional host directories. Format: host:container:mode, e.g. "/home/user/source:/source:ro". Global and per-agent binds are merged (under scope: "shared", per-agent binds are ignored).
Dangerous overrides
Threeagents.defaults.sandbox.docker.dangerouslyAllow* booleans lift sandbox security blocks. All default to false.
Images and setup
The default image isopenclaw-sandbox:bookworm-slim. Build it once:
curl, jq, nodejs, python3, and git:
docker.network: "none"). Override with agents.defaults.sandbox.docker.network. network: "host" and network: "container:<id>" are blocked by default (see Dangerous overrides for the namespace-join break-glass override).
openclaw doctor checks the sandbox image and offers to build or switch it when sandboxing is enabled but the image is missing.
Resource limits and hardening
agents.defaults.sandbox.docker caps what a sandbox container can consume. Unset keys fall back to the Docker daemon default.
Isolation defaults are already hardened:
readOnlyRoot: true, capDrop: ["ALL"], and tmpfs mounts at /tmp, /var/tmp, /run. seccompProfile and apparmorProfile accept a path or profile name; unconfined is rejected for both.
docker blocks override these keys per agent; under scope: "shared" the per-agent block is ignored (same rule as binds). Changes apply to containers created after the next config load — existing containers keep their settings until recreated.
Auto-prune
agents.defaults.sandbox.prune force-removes sandbox and sandbox-browser containers (docker rm -f plus their registry entries, running or not). The prune pass runs at most every 5 minutes; a container is pruned when either condition hits:
Set both to
0 to disable auto-prune entirely. Per-agent prune blocks are ignored under scope: "shared".
Sandbox vs tool policy vs elevated
Three related but distinct controls decide whether a tool runs and where:- Sandbox (
agents.defaults.sandbox.*) decides where tools run — Docker vs host. - Tool policy (
tools.*,tools.sandbox.tools.*,agents.list[].tools.*) decides which tools are available. - Elevated (
tools.elevated.*) is an exec-only escape hatch to run on the host while sandboxed.
- Tool policy is the hard stop.
denyalways wins; ifallowis non-empty, everything else is blocked. - Tool policy applies before sandbox rules — sandboxing never re-enables a denied tool.
/execonly adjusts per-session exec defaults for authorized senders; it cannot override a deniedexectool.- Elevated does not grant extra tools and does not override allow/deny.
/elevated onrunsexecon the host (approvals may still apply);/elevated fullskips exec approvals for the session.
Debugging “why is this blocked?”
Tool groups
Sandbox tool policy acceptsgroup:* shorthands:
Minimal enable example
Related: Security hardening · Gateway configuration · Doctor