Sandbox vs Tool Policy vs Elevated
OpenClaw has three related (but different) controls:- Sandbox (
agents.defaults.sandbox.*/agents.list[].sandbox.*) decides where tools run (Docker vs host). - Tool policy (
tools.*,tools.sandbox.tools.*,agents.list[].tools.*) decides which tools are available/allowed. - Elevated (
tools.elevated.*,agents.list[].tools.elevated.*) is an exec-only escape hatch to run outside the sandbox when you’re sandboxed (gatewayby default, ornodewhen the exec target is configured tonode).
Quick debug
Use the inspector to see what OpenClaw is actually doing:- effective sandbox mode/scope/workspace access
- whether the session is currently sandboxed (main vs non-main)
- effective sandbox tool allow/deny (and whether it came from agent/global/default)
- elevated gates and fix-it key paths
Sandbox: where tools run
Sandboxing is controlled byagents.defaults.sandbox.mode:
"off": everything runs on the host."non-main": only non-main sessions are sandboxed (common “surprise” for groups/channels)."all": everything is sandboxed.
Bind mounts (security quick check)
docker.bindspierces the sandbox filesystem: whatever you mount is visible inside the container with the mode you set (:roor:rw).- Default is read-write if you omit the mode; prefer
:rofor source/secrets. scope: "shared"ignores per-agent binds (only global binds apply).- Binding
/var/run/docker.sockeffectively hands host control to the sandbox; only do this intentionally. - Workspace access (
workspaceAccess: "ro"/"rw") is independent of bind modes.
Tool policy: which tools exist/are callable
Two layers matter:- Tool profile:
tools.profileandagents.list[].tools.profile(base allowlist) - Provider tool profile:
tools.byProvider[provider].profileandagents.list[].tools.byProvider[provider].profile - Global/per-agent tool policy:
tools.allow/tools.denyandagents.list[].tools.allow/agents.list[].tools.deny - Provider tool policy:
tools.byProvider[provider].allow/denyandagents.list[].tools.byProvider[provider].allow/deny - Sandbox tool policy (only applies when sandboxed):
tools.sandbox.tools.allow/tools.sandbox.tools.denyandagents.list[].tools.sandbox.tools.*
denyalways wins.- If
allowis non-empty, everything else is treated as blocked. - Tool policy is the hard stop:
/execcannot override a deniedexectool. /execonly changes session defaults for authorized senders; it does not grant tool access. Provider tool keys accept eitherprovider(e.g.google-antigravity) orprovider/model(e.g.openai/gpt-5.4).
Tool groups (shorthands)
Tool policies (global, agent, sandbox) supportgroup:* entries that expand to multiple tools:
group:runtime:exec,bash,process,code_executiongroup:fs:read,write,edit,apply_patchgroup:sessions:sessions_list,sessions_history,sessions_send,sessions_spawn,sessions_yield,subagents,session_statusgroup:memory:memory_search,memory_getgroup:web:web_search,x_search,web_fetchgroup:ui:browser,canvasgroup:automation:cron,gatewaygroup:messaging:messagegroup:nodes:nodesgroup:agents:agents_listgroup:media:image,image_generate,ttsgroup:openclaw: all built-in OpenClaw tools (excludes provider plugins)
Elevated: exec-only “run on host”
Elevated does not grant extra tools; it only affectsexec.
- If you’re sandboxed,
/elevated on(orexecwithelevated: true) runs outside the sandbox (approvals may still apply). - Use
/elevated fullto skip exec approvals for the session. - If you’re already running direct, elevated is effectively a no-op (still gated).
- Elevated is not skill-scoped and does not override tool allow/deny.
- Elevated does not grant arbitrary cross-host overrides from
host=auto; it follows the normal exec target rules and only preservesnodewhen the configured/session target is alreadynode. /execis separate from elevated. It only adjusts per-session exec defaults for authorized senders.
- Enablement:
tools.elevated.enabled(and optionallyagents.list[].tools.elevated.enabled) - Sender allowlists:
tools.elevated.allowFrom.<provider>(and optionallyagents.list[].tools.elevated.allowFrom.<provider>)
Common “sandbox jail” fixes
”Tool X blocked by sandbox tool policy”
Fix-it keys (pick one):- Disable sandbox:
agents.defaults.sandbox.mode=off(or per-agentagents.list[].sandbox.mode=off) - Allow the tool inside sandbox:
- remove it from
tools.sandbox.tools.deny(or per-agentagents.list[].tools.sandbox.tools.deny) - or add it to
tools.sandbox.tools.allow(or per-agent allow)
- remove it from
“I thought this was main, why is it sandboxed?”
In"non-main" mode, group/channel keys are not main. Use the main session key (shown by sandbox explain) or switch mode to "off".
See also
- Sandboxing — full sandbox reference (modes, scopes, backends, images)
- Multi-Agent Sandbox & Tools — per-agent overrides and precedence
- Elevated Mode