OpenClaw's safety rails exist, but in version 2.0 most of them start switched off. The sandbox is off by default, and command execution defaults to full on gateway and node hosts. To use OpenClaw safely, turn on the Docker or Podman sandbox, keep workspace access at none or read-only, switch command execution to an allowlist that asks on anything unknown, keep the elevated escape hatch closed, and run the built-in audit. This guide explains each setting defensively, based on OpenClaw's official docs as of November 2026.
Why does OpenClaw need more setup than hosted agents?
Hosted agents such as Claude Duet or Meta Muse come with vendor-enforced limits. OpenClaw is open source (MIT) and runs on your hardware, so the limits are whatever you configure. The project's own security docs are candid: OpenClaw "is not a hostile multi-tenant security boundary for mutually adversarial users sharing one agent or gateway."
The wider record shows why defaults matter. Scans have found exposed OpenClaw instances in the tens of thousands, and by some scans more than 135,000. Koi researchers found 341 malicious skills out of 2,857 audited on ClawHub, 335 of them tied to the ClawHavoc campaign (see malicious agent skills). Thoughtworks' Technology Radar placed OpenClaw at "Caution", calling it "permission-hungry by nature".
- sandbox default in OpenClaw 2.0
- Off
- default exec security on gateway hosts
- full
- default ask setting for exec
- off
- default askFallback when no approver responds
- deny
How do I turn on the sandbox?
The sandbox lives under agents.defaults.sandbox and supports Docker and Podman backends, per the tool permissions docs. The docs show mode: "off" and mode: "all" in examples; "Full access (no sandbox)" is the profile with sandbox: { mode: "off" }. Set it so tools run in the sandbox.
Scope
| Setting | Value | Meaning |
|---|---|---|
scope |
"agent" (default) |
One sandbox per agent |
scope |
"session" |
One per session; stricter |
scope |
"shared" |
Shared across agents; weakest |
Per OpenClaw's tool permissions docs, as of November 2026.
Choose "session" if your agent handles content from people you do not fully trust.
Workspace access
workspaceAccess |
What the agent sees |
|---|---|
"none" (default) |
A sandbox workspace under ~/.openclaw/sandboxes |
"ro" |
Your workspace, read-only, at /agent |
"rw" |
Your workspace, read-write, at /workspace |
Keep "none" or "ro". The docs' read-only profile pairs workspaceAccess: "ro" with tools.deny covering write, edit, apply_patch, exec, process and browser.
How do command approvals work?
OpenClaw's exec approvals follow one rule: "Commands run only when policy + allowlist + (optional) user approval all agree."
- Agent wants a command
- Policy allows it?
- On the allowlist?
- Ask you if needed
- Runs, or is denied
The key settings
security: deny, allowlist or full. Default is full on gateway and node hosts and deny on sandbox hosts. Change gateway and node hosts to allowlist.ask: off, on-miss or always. Default is off. Set on-miss so commands outside the allowlist need your approval.askFallback: what happens if nobody answers. Default is deny. Leave it.tools.exec.strictInlineEval: default false. Setting it to true makes inline code, such aspython -c, approval-only.- Per-agent overrides go under
agents.entries.<agentId>.tools.exec, so a research agent can be stricter than a coding one.
The docs prefer allowlists over full mode. Allowlists are per-agent globs. "Always allow here" applies only to the same command in that directory. Note that autoAllowSkills acts as an implicit convenience allowlist for skills, so review it if you install third-party skills.
Where approval prompts appear
Prompts go to the Control UI or the macOS app ("Allow Once"). Approvals for automated runs go only to approval clients, not to chat channels, which stops a message in a chat from approving a command.
Which tools should stay off?
The elevated escape hatch
tools.elevated is, in the docs' words, the "escape hatch that runs exec outside the sandbox". The docs say: "Keep tools.elevated.allowFrom tight and do not enable it for strangers."
Tools to deny for untrusted content
If the agent reads email, web pages or messages from people you do not know, the docs advise denying gateway, cron, sessions_spawn and sessions_send. These let an agent change its own setup, schedule tasks or reach other conversations. By default, agents with message-tool access can send across conversations.
Paired Mac nodes
If you pair a Mac, the node's system.run "is remote code execution on that Mac". To disable it, set its security to deny and remove the pairing if you do not need it.
The docs also warn against combining ask-mode exec with unrestricted computer use for an untrusted model.
What else belongs on the checklist?
- Bind to loopbackKeep the Gateway on 127.0.0.1 (port 18789); container images default to an exposed bind.
- Reach it privatelyUse Tailscale or an SSH tunnel, never an open port.
- Use pairing for DMsLeave unknown senders on pairing codes, or use an allowlist.
- Run as a low-privilege userNot your admin account.
- Pin skillsInstall skills pinned to a commit hash and review them.
- AuditRun openclaw security audit and openclaw policy after every change.
DM modes are pairing, allowlist, open and disabled; by default, unknown senders get a pairing code. Avoid "open". For the full list, see OpenClaw security hardening and check whether your gateway is exposed.
What OpenClaw's security policy does not cover
OpenClaw's security policy has no paid bug bounty, and prompt-injection-only attacks are out of scope. Research settings have shown high attack success against agents like OpenClaw; the MemGhost paper reported 87.5% against OpenClaw with GPT-5.4 in its experiments. Treat the sandbox and approvals as your main defence, and remove one leg of the lethal trifecta wherever you can.
Bottom line
OpenClaw can be run safely, but only deliberately. Sandbox on, workspace limited, exec on allowlist with ask on-miss, elevated closed, risky tools denied, gateway on loopback, audit run. If that sounds like more than you want to maintain, read is self-hosting an AI agent safe. For installation, see our sister site's OpenClaw self-hosting guide, and UK readers can see OpenClaw self-hosting in the UK.



