Sandboxing

Sandboxing

A sandbox is a security mechanism for separating running programs for your OS. It provides a tightly controlled set of resources for guest programs to run in: storage and memory scratch space, limited network access, the ability to inspect the host system, disallowed or heavily restricted reading from input devices.

Operating systems have programs that implement sandboxes:

/sandbox command checks dependencies (e.g. bubblewrap (bwrap), socat, seccomp filter) and lets you configure Mode (Sandbox BashTool with auto-allow / Sandbox BashTool with regular permissions / No Sandbox), Overrides, and Config.

Claude Code can run a session within a sandbox, using the underlying sandbox programs to run commands in isolation. This is very useful when running a session with --dangerously-skip-permissions.

The sandbox only applies to the Bash tool. It does not restrict other tools — Read, Write, Edit, WebSearch, WebFetch, MCP tools, hooks, or internal commands. Example: Bash(curl https://example.com) → denied due to sandbox network restrictions if the domain isn't in the allowed hosts list.

Related: Permission Modes, Requirements