Claude Code sandbox: devcontainer isolation, egress filtering, and zero exposed secrets

Hansehart · reddit · 2026-09-05

A developer who lets Claude write nearly all his production code shares his security-first devcontainer setup: run Claude Code in a standardized devcontainer (noting Docker shares the host kernel; VMs or Docker sbx are safer), keep secrets entirely outside the agent's reach, and apply an egress filter so container processes can only hit explicitly whitelisted hosts. For productivity he stacks multiple projects and worktrees, static typing/lints/TDD/e2e tests, open-source-only dependencies, a VSCode workspace, and Docker-in-Docker (DinD) so broken builds surface before any push or deploy. He also advises not burning tokens one by one and building a way to measure progress. Next steps: minikube and better UX; requires familiarity with VSCode and devcontainers.

Original post →

More from coding & agent

coding & agent channel →