How to run OpenClaw safely without giving an AI agent your laptop
Review OpenClaw access boundaries, tool permissions, credential scope, browser isolation, logs, and retention before production use.

To run OpenClaw safely, turn on its sandbox first. OpenClaw's sandbox is off by default. Once enabled, tool execution moves into the sandbox. The Gateway itself stays on your host. Keep elevated exec off. Allow only the tools each task needs. Run openclaw security audit after every config change. Keep agent browsing out of your daily browser profile.
Permissions define OpenClaw's real blast radius. The sandbox decides where tools run. Tool policy decides which tools exist. Neither control replaces the other.
Is it safe to run OpenClaw on your laptop?
OpenClaw ships with conservative access defaults. On a regular host install, the Gateway binds to loopback. Most chat channels answer unknown senders with a pairing code. OpenClaw's security guide lists these defaults.
Tool execution is a different story. Sandboxing is off by default. Without it, exec runs on your host. Without a profile, local onboarding sets the full tool profile. That profile selects tools without granting full execution permissions.
Local installs run the OpenClaw Gateway on your machine. Mistakes then land next to your files, sessions, and credentials. The practical tradeoff is authority versus convenience. Start with the smallest environment that finishes the task. Add authority only when evidence demands it.
How do you sandbox OpenClaw?
OpenClaw's documentation covers each control below. Apply them in this order, then verify.
- Turn on the sandbox. Set
agents.defaults.sandbox.modetoall. The default isoff. Modenon-mainleaves the main session unsandboxed. - Give each session its own sandbox. Set
scopetosession. The defaultagentscope shares one container per agent. - Keep the workspace hidden. Leave
workspaceAccessatnone, the default. Userowhen tools must read files. Docker bind mounts pierce the sandbox filesystem. - Keep elevated exec off. Elevated mode runs
execoutside the sandbox. It works only whentools.elevated.enabledis true. Keep it false. - Deny tools a task does not need. OWASP traces excessive agency to extra functionality and permissions. Deny always wins in OpenClaw tool policy. Deny
execwhen a task needs no shell. Sandboxing never brings a denied tool back. - Give the browser its own profile. Browser control hands the model a real browser. A logged-in profile exposes its accounts to the model. Use the dedicated
openclawprofile, never your daily one. The agent browser isolation guide explains why. - Audit after every change. Run
openclaw security audit. The--fixflag applies a narrow set of remediations. - Split trust boundaries. OpenClaw assumes one trust boundary per gateway. Give each boundary its own gateway and credentials.
The config below combines OpenClaw's documented examples. Every key and value appears in its docs. Docker tool containers already default to no network.
{
agents: {
defaults: {
sandbox: {
mode: "all", // default: "off"
scope: "session", // default: "agent"
workspaceAccess: "none", // already the default
docker: { network: "none" }, // already the default: no egress
},
},
},
tools: {
elevated: { enabled: false },
},
}Confirm the result with openclaw sandbox explain. The command prints the effective sandbox and tool policy.
OpenClaw safety settings at a glance
Each row shows a default and a safer choice. Defaults reflect OpenClaw's docs as of October 30, 2026.
| Control | Setting or command | Default | Safer choice | Source |
|---|---|---|---|---|
| Sandbox mode | agents.defaults.sandbox.mode | off | all | Modes and scope |
| Sandbox scope | agents.defaults.sandbox.scope | agent | session | Modes and scope |
| Workspace access | agents.defaults.sandbox.workspaceAccess | none | Keep none, or ro to read files | Workspace access |
| Docker tool network | agents.defaults.sandbox.docker.network | none, no egress | Keep none | Docker backend |
| Elevated exec | tools.elevated.enabled | Enabled only by config | false | Elevated mode |
| Tool profile | tools.profile | full after local onboarding | The narrowest profile that fits | Tool policy |
| Browser profile | Agent browser profile | openclaw, a dedicated profile | Never your daily profile | Browser control |
| Host browser access | agents.defaults.sandbox.browser.allowHostControl | false | Keep false | Docker backend |
| Computer use on macOS | Allow Computer Control | on | Off unless a task needs it | Computer use |
What the OpenClaw sandbox does not cover
OpenClaw's docs call the sandbox "not a perfect security boundary." The sandbox still limits filesystem and process access. The Gateway process always stays on the host. Only tool execution moves inside.
- File denies do not stop the shell. If
execstays allowed, shell commands can still write files. Denyexecas well when files matter. - Bind mounts cross the boundary. Whatever you mount is visible inside the container. Mounting the Docker socket hands host control to the sandbox.
- Computer use has no per-action prompt. OpenClaw authorizes computer use through tools, pairing, and OS permissions. On macOS, Allow Computer Control starts enabled. Once macOS grants exist, there is no per-action confirmation. Turn the setting off when no task needs it.
- Page content is untrusted input. Screens and pages can carry indirect prompt injection. A sandbox limits damage, not what the model believes.
- Browser egress needs its own policy. OpenClaw's browser blocks private network destinations by default. The docs say routing is not a network firewall.
Who should care first
- Developers trying coding agents for the first time. Test OpenClaw before it touches your main machine.
- Security-conscious teams. Give people room to experiment. Keep agents off unmanaged endpoints.
- People comparing OpenClaw with other agents. One permission and retention checklist keeps results comparable.
- Teams standardizing agent reviews. A repeatable boundary is easier to audit.
What to look for in an OpenClaw sandbox
Not every "secure environment" is equally useful. Judge a sandbox on five practical criteria.
- Permissions are explicit. List every tool, mount, credential, and destination.
- Low setup friction. People bypass a safer option that is harder to use.
- A defined session lifecycle. Define how sessions start, close, time out, and fail.
- Evidence of retention. Check storage, logs, profiles, credentials, and connected systems afterward.
- A workflow you will repeat. The best setup is the one people keep using.
Where Legba fits in an OpenClaw setup
Legba covers one part of this setup: the browser. The agent skill gives agents routing and isolated browser sessions. OpenClaw loads it like any other skill.
The skill's published source lists an OpenClaw install path. Run the command below, then pick OpenClaw when prompted.
npx skills add legba-app/skillsSee how to install the Legba skill. Compare agent plans before you choose one. See Legba for agents for the full product.
Hosted browser sessions run on Legba infrastructure. Local browsers run on your machine. Hosted sessions require an eligible paid plan. A person can take over for a login step. The skill tells the agent never to type a credential.
Legba does not sandbox OpenClaw's shell, files, or Gateway. Keep every OpenClaw control above turned on. OpenClaw's docs call third-party skills untrusted code. Legba's skill is no exception. Read its source before you enable it.
How this guide was made
Every OpenClaw fact here comes from its official documentation. Legba did not test these settings hands-on. Settings and defaults can change between OpenClaw releases. Check your own install with openclaw sandbox explain.
Legba publishes this guide and sells the agent skill. Sources were checked on October 30, 2026.
FAQs.
Is OpenClaw's sandbox on by default?
What does tools.elevated do in OpenClaw?
Does OpenClaw ask before each computer-use action?
Is running OpenClaw locally always a bad idea?
What should I evaluate in an OpenClaw sandbox first?
Where does Legba fit in a safe OpenClaw setup?
Related reading on agent isolation
More on browser isolation, prompt injection, and AI security.
Browser isolation for AI agents: why the old playbook fits the new problem
Browser isolation kept untrusted pages away from human endpoints. AI agents need the same boundary around execution, identity, and session lifetime.
Indirect prompt injection targets browser agents
A browser agent can follow instructions hidden in the content it reads. Learn how to limit browser execution, tools, and approvals.
The agent didn’t go rogue. The containment did.
An evaluation agent crossed a package proxy boundary. The Hugging Face incident shows why containment needs evidence, scoped access, and independent controls.