Configuration#
Reference for the two configuration surfaces: the host-global config
file /etc/claude-sandbox.conf and the CLAUDE_SANDBOX_* environment
variables. For task recipes see the how-to guides.
/etc/claude-sandbox.conf#
The shadow reads this file at every launch. It is installed by
install.sh from the clone’s .devcontainer/claude-sandbox.conf and
re-stamped on every rebuild via postCreate. It lives at /etc, not
in the rw-bound workspace, so a compromised session cannot rewrite it
to widen the next launch’s binds — or, with allow-ip, its network
reach. To change it, edit the clone conf and
re-run ./install (a rebuild does it via postCreate).
A missing file is a no-op (parse_config returns). The installer
skips placing it if the clone carries no conf. File mode is 0644.
Format#
One directive per line.
key = value, or a barekeyfor boolean flags.Blank lines and
#comments are ignored.Environment variables already set take precedence — the config supplies defaults.
Keys#
Key |
Value |
Effect |
|---|---|---|
|
absolute path |
Sets the rw bind-mount root if |
|
bare flag (no value) |
Equivalent to |
|
absolute path |
Adds an extra writable bind. Repeatable — each |
|
|
The per-process network egress jail (15. Jail Claude’s egress in a per-process netns with a routing allowlist) is ON by default; this key only needs to appear to turn it off on a host: |
|
bare IP (no CIDR) |
A device IP the egress jail keeps reachable past its RFC1918 blackhole (e.g. an EPICS IOC / PMAC / internal GitLab by bare address). Repeatable — each line punches one |
# .devcontainer/claude-sandbox.conf (installed to /etc/claude-sandbox.conf)
allow-write = /cache
allow-write = /workspaces/sibling-project
# Egress jail is ON by default; uncomment to disable on this host.
# egress-jail = 0
# Keep these device IPs reachable past the RFC1918 blackhole (bare IP):
allow-ip = 172.23.142.119 # internal GitLab
Environment variables#
Set these in your devcontainer’s remoteEnv (restart or rebuild for the
change to take effect). Names below are verified against the shadow and
installer sources.
Variable |
Set by / read by |
Meaning |
|---|---|---|
|
you ( |
Explicit rw bind-mount root. Set to |
|
you ( |
|
|
you → guard scripts |
|
|
you (env, per session) / conf |
Network egress jail toggle (15. Jail Claude’s egress in a per-process netns with a routing allowlist). Default ON; set to |
|
populated by |
Newline-separated device IPs the jail keeps reachable past the RFC1918 blackhole |
|
set by bwrap ( |
Sentinel proving the sandbox was entered. The shadow’s recursion guard falls through to the real binary when it is |
|
populated by |
Newline-separated extra writable paths bound in addition to the workspace |
|
exported by the shadow |
Path to the curated gitconfig ( |
|
Claude Code Web |
When |
|
set to |
Disables Claude Code’s in-container auto-updater (alongside |
CLAUDE_SANDBOX_NO_FORGE is documented as a task in
run a no-push session; workspace scope
is covered in widen the writable workspace.