# sandbox.enabled

> The key that runs Claude's shell commands inside a sandbox.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** sandbox enabled setting, "sandbox" key

## Think of it like

It is like putting a toddler in a play pen. They can play, but only inside the fence.

## Definition

sandbox.enabled is a settings key that turns on the sandbox for the Bash commands Claude runs. The sandbox fences each command off from your files and the network. It works on macOS, Linux and WSL2, and Linux needs bubblewrap and socat. The default is false. Choosing a mode in /sandbox writes this key to your local file.

## Example

Lucy lets Claude run tests in a repo she does not know well. She turns the sandbox on, so a bad script cannot touch her home folder.

## Example code

```json
{
  "sandbox": {
    "enabled": true
  }
}
```

Fence in every Bash command Claude runs.

## Why it matters

A shell command can do all that you can. The sandbox cuts that down to what the job needs.

## Common mistake

Thinking the key alone means it is on. If the sandbox cannot start, commands run without it, unless a second key stops that.

## Three principles

- **Fences Bash commands.** Files and network.
- **Off by default.** false.
- **Linux needs tools.** bubblewrap, socat.

## Related terms

- [Claude Code Sandbox](https://learn.benibix.com/term/ai/claude-code-sandbox)
- [Bash Tool](https://learn.benibix.com/term/ai/bash-tool)
- [sandbox.failIfUnavailable](https://learn.benibix.com/term/ai/fail-if-unavailable-setting)

![The path one Bash command takes: an excluded command runs outside the sandbox, the rest run inside, and autoAllowBashIfSandboxed decides if you are asked first.](https://learn.benibix.com/diagrams/sandbox-command-path.svg)

---

Source: https://learn.benibix.com/term/ai/sandbox-enabled-setting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
