Skip to main content

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.

Estimated reading time: 7 min read
Updated
A white robotic claw arm on a dark tray inside a red outline, with a red cable running to a red mounting block

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.

  1. Turn on the sandbox. Set agents.defaults.sandbox.mode to all. The default is off. Mode non-main leaves the main session unsandboxed.
  2. Give each session its own sandbox. Set scope to session. The default agent scope shares one container per agent.
  3. Keep the workspace hidden. Leave workspaceAccess at none, the default. Use ro when tools must read files. Docker bind mounts pierce the sandbox filesystem.
  4. Keep elevated exec off. Elevated mode runs exec outside the sandbox. It works only when tools.elevated.enabled is true. Keep it false.
  5. Deny tools a task does not need. OWASP traces excessive agency to extra functionality and permissions. Deny always wins in OpenClaw tool policy. Deny exec when a task needs no shell. Sandboxing never brings a denied tool back.
  6. 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 openclaw profile, never your daily one. The agent browser isolation guide explains why.
  7. Audit after every change. Run openclaw security audit. The --fix flag applies a narrow set of remediations.
  8. 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.

ControlSetting or commandDefaultSafer choiceSource
Sandbox modeagents.defaults.sandbox.modeoffallModes and scope
Sandbox scopeagents.defaults.sandbox.scopeagentsessionModes and scope
Workspace accessagents.defaults.sandbox.workspaceAccessnoneKeep none, or ro to read filesWorkspace access
Docker tool networkagents.defaults.sandbox.docker.networknone, no egressKeep noneDocker backend
Elevated exectools.elevated.enabledEnabled only by configfalseElevated mode
Tool profiletools.profilefull after local onboardingThe narrowest profile that fitsTool policy
Browser profileAgent browser profileopenclaw, a dedicated profileNever your daily profileBrowser control
Host browser accessagents.defaults.sandbox.browser.allowHostControlfalseKeep falseDocker backend
Computer use on macOSAllow Computer ControlonOff unless a task needs itComputer 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 exec stays allowed, shell commands can still write files. Deny exec as 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/skills

See 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?
Sandboxing is off by default. Set the sandbox mode to all. The setting is agents.defaults.sandbox.mode. Mode non-main leaves the main session on the host.
What does tools.elevated do in OpenClaw?
Elevated mode runs a sandboxed agent's exec outside the sandbox. The global gate tools.elevated.enabled must be true. The sender must also be allowlisted. Keep it false unless a trusted operator needs host commands.
Does OpenClaw ask before each computer-use action?
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.
Is running OpenClaw locally always a bad idea?
Local use is not automatically unsafe. Risk depends on what you grant. Count tools, files, credentials, and network access. Start with the smallest boundary that finishes the task. Test every exception you add.
What should I evaluate in an OpenClaw sandbox first?
Start with tools, mounts, and the browser profile. Then check credential scope and network reach. Review logs and retention next. Close the session and verify what remains.
Where does Legba fit in a safe OpenClaw setup?
Legba's agent skill covers the browser. It provides routing and isolated browser sessions. It does not sandbox OpenClaw's shell, files, or Gateway. Read the skill's source before you enable it.

More on browser isolation, prompt injection, and AI security.

About the authors.

Try it on the next page you do not trust

Legba is a Chrome extension with two modes. Ghost gives you a private browser route. Shield opens a page in an isolated browser off your device.

Free for 30 days. No card required.

Ghost. A private route for your browser. Shield. An isolated browser, off your device. Choose the mode. Close when finished.