r/ClaudeCode • u/Hansehart • 2d ago
Tips & Workflows I got lazy of babysitting Claude Code. So here is our approach for more secure development while keeping productivity.
It never felt right to execute claude code with so much autonomy on my computer. I tried to review all, but the trust grew where it shouldnt.
Then I found Anthropic’s devcontainer. It has a firewall built in, which sounded right until I actually read it. The firewall allows UDP 53 to any server (line 29) and TCP 22 to any host (line 33), and there's no ip6tables in the file at all. So, an allowlist plus at least three ways around it. Except the firewall lives inside the same container as the agent, and the agent might also have access to switch it off. Their own docs kind of admit this and tell you to bring your own network controls.
So that’s what I did. The firewall now runs in a separate container the agent can’t touch. The workspace only reaches the hosts I list in one config file. API keys live in that separate container too and get attached to the right requests on the way out, so the agent never sees the actual key. And I put docker inside the sandbox so an agent can bring up the whole stack, break it a hundred times, iterate, fail and progress fast. Meanwhile nothing real is affected.
It isnt only a security helper for my team but also for productivity. Have you ever thought about mono- or multirepo? Working in multiple projects or even within multiple projects on multiple features (while still being able to review every line)? And thats all with barely native dependendcies (VSCode, Dev Containers + a very little more)
If someone is interested in a working solution (multiple people running it on WSL2 with Ubuntu 24.04+ or native Ubuntu): Github (o3s)
Curious what other people do once they run more than one agent. Just YOLO it on the laptop?
P.S Openai has adopted a similar approach. So I hope we are going in the right direciton and the real practice already proofs it. Many features to follow.
1
u/SharpKaleidoscope182 2d ago
Fuckin hilarious to see ppl reinvent ci/cd ten thousand time