excludedCommands vs allowUnsandboxedCommands
People think both keys let commands out of the sandbox in the same way. excludedCommands is a fixed list you write, and those commands always run with no fence. The other key decides if Claude may ask to rerun a blocked command with no fence. A strict setup turns the second key off and keeps the list short.
sandbox.excludedCommands
A list of commands that run outside the sandbox.
sandbox.excludedCommands is a settings key that names commands to run with no fence, such as tools that break in the sandbox. Each entry is written like a Bash rule: an exact command, or a start such as docker *. An entry must match each command in a call. Commands that start with sudo, eval or xargs stay fenced.
sandbox.allowUnsandboxedCommands
The key that says if Claude may run a blocked command with no fence.
sandbox.allowUnsandboxedCommands is a settings key. It decides if Claude may try a blocked command again, this time with no fence. The default is true, so Claude can ask to do that. Set it to false for a strict sandbox, and Claude Code ignores the ask. Then only the commands in excludedCommands run with no fence.
In one line
- sandbox.excludedCommands
- A list of commands that run outside the sandbox.
- sandbox.allowUnsandboxedCommands
- The key that says if Claude may run a blocked command with no fence.