Codex and Claude Code default sandboxes still expose ~/.ssh and skip MCP
Independent-Sir3234 · reddit · 2026-12-04
Both OpenAI Codex and Claude Code leave surprisingly wide security holes in their default sandboxes.
Claude Code
- Bash sandbox restricts writes but reads still cover /.ssh and /.aws/credentials
- Built-in tools (Read, WebFetch, etc.), local MCP servers, hooks and LSPs run outside the sandbox; denyRead doesn't bind the Read tool, allowedDomains doesn't bind WebFetch
- Silently falls back to unsandboxed execution on Linux/WSL2 unless failIfUnavailable: true
Codex
- Protected dirs like .aws are read-only, not read-denied
- A leftover sandboxmode config or --sandbox flag silently overrides custom [permissions] profiles
- Without [features] networkproxy = true, the domain allowlist is ignored entirely
- The proxy doesn't filter MCP connections, web search, or browser activity; deny-read globs are snapshotted at process start
The author shares working TOML and JSON configs to actually lock both down, and recommends running the agent process itself in an OS sandbox.
More from coding & agent
- AWS open-sources scripts to monitor Quick and Kiro usage with agent-hour cost allocation — AWS ML Blog · 2026-12-04
- Viktor agent lifts merged PRs per engineer from 20 to 195 per week — ThePeterMick · 2026-12-04
- Power user juggling $300/month across Google, OpenAI and Anthropic AI subscriptions — burny_tech · 2026-12-04
- TaskCarry MCP server cuts project audit time from 5h49m to 69 seconds — Bryan_TaskCarry · 2026-12-04
- Man fixes his 1994 Jeep's emissions computer with Claude and a $3 Arduino — brianwilt · 2026-12-04
- React dev Andrew Clark: in the AI era, do the hard thing first—shortcuts are 'irresponsible' — Vjeux · 2026-12-04