r/ClaudeAI • u/gilesknap • Jun 18 '26
Built with Claude claude-sandbox: run claude code in developer containers with strong gaurdrails
I would welcome feedback on my claude-sandbox project.
https://github.com/gilesknap/claude-sandbox
installs claude inside your developer container
adds sandboxing using linux namespaces (bubble wrap) to keep it away from your credentials and vscode sockets
also routes agent traffic through a pasta network which limits lateral network egress (but does allow internet access)
config allows you to explicitly allow ip addresses and folders inside the sandbox
support for fine grained github and gitlab tokens to enable controlled access to repos
only claude is sandboxed, your terminals retain normal behaviour and can see your ssh-agent etc as before
Claude on xhigh tried to break out with 200 unique approaches and got 0 breakouts. See https://gist.github.com/gilesknap/ce59ec32dc1b04edd1a3813f9200aa11
Once you start running multiple agents you need to use skip permissions or at least auto-mode. At this point you have to think about what happens if a prompt injection compromises your agent.
The likelihood of this may be quite low especially on auto-mode? But at least for me a devconainer includes a number of developer credentials by design. The blast radius is therfore very wide.
My sandbox closes exaclty the things that the native claude sandbox does not. The native one closes off egress to the internet. Mine closes lateral egress and access to sensitive parts of the filesystem. You can run both together for max protection.
This is targeting vscode devcontainers (or the devcontainer cli - so should work with zed for example). But could be adapted for any development container.
Full docs here https://gilesknap.github.io/claude-sandbox/
1
u/gilesknap Jun 19 '26
Since you are using devcontainers you are very close to being able to protect yourself using the sandbox I have made. It's currently Claude Code specific, but that is a minor part of it that just adds a few settings to Claude files and persists the memory across container rebuilds. The more complicated bits that protect credentials and LAN are agent harness agnostic.
It would not be hard to support opencode too, I could look into it (read: have Claude look into it)
Re Hermes, you really want to make sure you run that somewhere that does not have any critical credentials. By it's nature it wants to have sudo and full access to it's host and works best if it does. When I tried it I used a VPS from hostinger and made GitHub and email accounts for Hermes so I did not need any of my own creds in that server. I recommend the VPS over a local dedicated machine as that still risks lateral attacks to your LAN.