Cowork sandbox network allowlist not affected by sandbox.enabled toggle in settings
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After toggling sandbox.enabled in ~/.claude/settings.json, the Cowork ("dispatch") Linux sandbox stayed network-restricted regardless of the setting. Turning sandbox mode off did not lift the restriction.
Environment
- macOS (Darwin 24.6.0), Claude Code + Cowork mode
~/.claude/settings.json->sandbox.enabled: false, with a populatedsandbox.network.allowedDomains(incl.*.cloudflare.com,hazards.fema.gov)- No
/Library/Application Support/ClaudeCode/managed-settings.jsonpresent
Steps to reproduce
- Set
sandbox.enabled: trueand add domains (e.g.*.cloudflare.com,hazards.fema.gov) tosandbox.network.allowedDomains. - In a Cowork session, run a curl loop against those domains from the sandbox shell.
- Set
sandbox.enabled: false. - Re-run the loop.
Test loop used:
for u in https://api.cloudflare.com/client/v4 https://cloudflare.com https://www.google.com https://hazards.fema.gov https://registry.npmjs.org; do
c=$(curl -sS -o /dev/null -w "%{http_code}" --max-time 15 "$u" 2>/dev/null); echo "$c $u"
done
Actual
In both states, only the platform's built-in allowlist applies. Unlisted domains return curl exit 56 (HTTP 403 from proxy, header X-Proxy-Error: blocked-by-allowlist); listed domains like registry.npmjs.org return 200. Result from inside the Cowork sandbox:
000 https://api.cloudflare.com/client/v4
000 https://cloudflare.com
000 https://www.google.com
000 https://hazards.fema.gov
200 https://registry.npmjs.org
The same loop on the host Mac (CLI, sandbox off) returns normal codes for all five.
Root cause (observed)
The Cowork sandbox enforces egress via an external proxy (localhost:3128) reading a platform policy at /etc/srt-settings.base.json (plus per-request /etc/srt-settings/oneshot-*.json). This policy is independent of ~/.claude/settings.json, so user sandbox settings have no effect on the Cowork sandbox, and there is no user-facing way to change it. The in-sandbox policy file is root-owned and unwritable; sudo is disabled (no-new-privileges).
What Should Happen?
Either honor the user's sandbox settings (sandbox.enabled, sandbox.network.allowedDomains) in Cowork sessions, or clearly document that Cowork's sandbox allowlist is platform-fixed and separate from the CLI's sandbox config — so the settings do not appear to be silently ignored.
Error Messages/Logs
curl: (56) Received HTTP code 403 from proxy after CONNECT
< HTTP/1.1 403 Forbidden
< X-Proxy-Error: blocked-by-allowlist
Inside Cowork sandbox:
000 https://api.cloudflare.com/client/v4
000 https://cloudflare.com
000 https://www.google.com
000 https://hazards.fema.gov
200 https://registry.npmjs.org
Steps to Reproduce
- In
~/.claude/settings.json, setsandbox.enabled: trueand add domains tosandbox.network.allowedDomains(e.g.*.cloudflare.com,hazards.fema.gov). - Open a Cowork session and run this loop from the sandbox shell:
````
for u in https://api.cloudflare.com/client/v4 https://cloudflare.com https://www.google.com https://hazards.fema.gov https://registry.npmjs.org; do
c=$(curl -sS -o /dev/null -w "%{http_code}" --max-time 15 "$u" 2>/dev/null); echo "$c $u"
done
- Observe that the domains you allow-listed still return 000 (blocked), while only the platform defaults (e.g. registry.npmjs.org) return 200.
- Set
sandbox.enabled: falseand re-run the same loop. - Observe the result is unchanged — the Cowork sandbox is still restricted, and the same loop run on the host Mac (CLI, sandbox off) returns normal codes for all five domains.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.260 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗