Claude Code, Codex and Cursor will all run commands on your machine if you let them. Each now documents a local sandbox: an operating-system boundary around those commands, so a routine test or a file edit does not automatically have the same reach as you do. That is worth turning on. It is also easy to treat as "the agent is isolated," which is more than the docs claim.

This post is a sourced comparison of those local sandbox modes with a different shape: a cloud microVM per agent, which the team administers. The vendor behaviour comes from their public documentation, read on 2 December 2026:

Sandscale commands are from CLI 1.4.1. We do not show command output.

What a local sandbox is for

The three products describe the same idea in slightly different words. A local sandbox is a boundary the operating system enforces around commands the agent starts on your laptop. Inside the boundary, the agent can do routine work without asking every time. Outside it, an approval policy decides whether the agent stops and asks.

Codex's docs put the split cleanly: "Sandboxing and approvals are different controls that work together. The sandbox defines technical boundaries. The approval policy decides when the agent must stop and ask before crossing them."

That is a real improvement on an unsandboxed laptop session. It is still a session on your laptop.

What each vendor's docs say the sandbox covers

Claude Code. The built-in sandbox, off by default, covers "Bash, PowerShell, and Monitor commands and the processes they start." It is turned on with /sandbox or sandbox.enabled in a settings file. The docs are direct about what sits outside it: "Claude's file tools, MCP servers, and hooks run outside it." Default writes are limited to the working directory, a per-user temp directory and directories you add; protected paths stay write-denied. Default reads are "most of the machine, including credential files such as ~/.ssh and ~/.aws/credentials," unless you tighten them. Network has no direct route out; connections go through a proxy on your machine that checks allowed domains, which start empty. The sandbox runs on macOS, Linux and WSL2. "On native Windows, Claude Code runs commands unsandboxed." Anthropic also documents a separate sandbox runtime that isolates the whole Claude Code process, including file tools, MCP servers and hooks, and compares those options with dev containers, custom containers, virtual machines and cloud sessions.

Codex. The sandbox "applies to spawned commands, not just to built-in file operations," and "uses platform-native enforcement on each OS": Seatbelt on macOS, a native Windows sandbox in PowerShell (and the Linux implementation in WSL2), and bubblewrap on Linux and WSL2. The documented sandbox modes are read-only (inspect, but do not edit or run commands without approval), workspace-write (read, edit within the workspace, and run routine local commands; "the default low-friction mode for local work"), and danger-full-access (no sandbox restrictions). Approval policies are on-request (ask when the agent needs to go beyond the sandbox) and never. The lower-risk local preset the docs recommend is --sandbox workspace-write --ask-for-approval on-request. untrusted is no longer a selectable approval policy.

Cursor. Run modes, under Settings > Agents > Approvals & Execution, decide how tool calls run and when Cursor asks for approval. The docs describe Auto-review as the "safest useful setup for most people": allowlisted calls run immediately, other shell commands run in the sandbox when they can, and calls that cannot use the sandbox go to a classifier. A command "can run in the sandbox" when it works under the sandbox's file and network limits; commands that need full network access, writes outside the workspace, or privileged operations cannot, so they go to the classifier. If a sandboxed command fails on a sandbox restriction, "the agent can rerun it outside the sandbox. The classifier reviews that rerun." Cursor's docs say plainly: "Auto-review is not a security boundary. The classifier can make mistakes." Sandboxed terminal commands, by default, can read and write inside the workspace; paths such as .git/config and .git/hooks are protected; network is "blocked by default, then opened by your network mode and sandbox.json."

What a local sandbox does not change

These limits follow from the docs, and from where the process runs.

The agent is still on your laptop. Close the lid, lose power, drop the office network, and a local session stops. Our post on agents that keep working when the laptop sleeps is about that problem, and a local sandbox does not solve it.

A lot of the process may sit outside the boundary. Claude Code's built-in sandbox does not cover file tools, MCP servers or hooks. Cursor will, in documented cases, rerun a command outside the sandbox after a restriction failure, subject to the classifier. Codex's danger-full-access mode removes the boundary entirely. Anthropic's comparison page says the same thing we would: "Sandbox isolation reduces the impact of a breach, but it does not eliminate risk. Any approach that allows network egress can still leak data the agent can read, and any approach that mounts your project directory writable can still modify that code."

Reads can still reach credentials. Claude Code's default is to allow reads of most of the machine, including ~/.ssh and ~/.aws/credentials, until you deny them. Other tools are stricter by default. Either way, the files are on the same laptop.

Several agents still share one machine. A sandbox does not give each agent its own disk, ports, CPU and toolchain. Two agents on one laptop still compete, and still see whatever that laptop holds.

The vendor's cloud is a different product. Claude Code cloud sessions, Codex Cloud and Cursor Cloud Agents run that vendor's agent on that vendor's infrastructure. They are not a machine the team administers, and they are not interchangeable across vendors. We compare them separately in vendor agent clouds.

A cloud microVM per agent

The other shape is to move the agent off the laptop and onto a machine of its own. On Sandscale, that machine is a workspace: a persistent Firecracker microVM with its own disk, CPU, memory and network policy, one per agent. The whole agent process runs there, including file edits, shell commands, MCP servers and hooks, not only the commands a local sandbox wraps. The disk keeps the repository, the toolchain and the session. The laptop becomes a window you can close.

sandscale workspace create --name agent-upgrade --template-id TEMPLATE_ID --ttl-seconds 28800 sandscale workspace ssh agent-upgrade 

For commands the agent should not run even on its own machine, a shorter-lived sandbox is still the right tool: a fresh microVM, network off by default, discarded after the result comes back. Our post on Claude Code hooks that route Bash to a sandbox is one way to send those commands there automatically.

A running workspace counts toward the plan's hours whether the agent is busy or waiting, so stop it when the task is done:

sandscale workspace stop --ws-id WORKSPACE_ID 

The disk is kept.

When to use which

  • Turn on the local sandbox for everyday work on a laptop. It is the right default, and the vendors' docs are the place to configure it. Tighten reads of credential paths. Do not treat Auto-review, or any classifier, as a hard control; the vendors who document one say it is not.
  • Do not use --dangerously-skip-permissions or danger-full-access on a laptop unless the whole process is inside a stronger boundary. Anthropic's sandbox-environments page says to run --dangerously-skip-permissions sessions inside a container, a VM or its sandbox runtime, "so that file tools, MCP servers, and hooks are also inside the boundary."
  • Give each agent its own cloud machine when the work should survive a closed lid, when several agents should run at once without sharing a laptop, or when the team wants one set of templates, secrets, policies and an audit log for Claude Code, Codex and Cursor together.

The local sandbox and the cloud machine are not competitors in the usual sense. One reduces what a command can reach on a laptop you are already using. The other is the laptop's replacement for unattended agent work. Most teams that get past a single enthusiastic engineer will want both.

Originally published on the Sandscale blog.