Menu

1 / 2

Turning on Claude Code's sandbox: what changes, and what still gets through

DEV Community: security·ProKit·about 1 hour ago
#Y1I54sYn
#devtosecurity#devto#dev#sandbox#default
Long article (546 words) — no AI summary yet.
Reading 0:00
15s threshold

Claude Code ships an OS-enforced sandbox for shell commands, and it is off by default. Turning it on changes two things at once: where the agent can write, and whether it can reach the network at all. It also leaves a few doors open that surprise people, because the sandbox covers shell commands and not every tool.

Here is what the docs say, and what to check after you flip it.

What the sandbox covers

Shell commands only. On macOS, Linux and WSL2 the sandbox is OS-enforced. On native Windows, commands run unsandboxed.

With it on, writes are limited to the working directory, a temp directory, and any directories you add. Reads are broader: most of the machine, including ~/.ssh and ~/.aws/credentials , unless you add denyRead rules.

What happens to the network

There is no direct route out. Traffic goes through a local proxy that checks hosts against an allowed-domains list, and that list starts empty.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.