Show HN: Zerobox – Sandbox any command with file, network, credential controls
by afshinmeh on 3/30/2026, 2:32:36 PM
I'm excited to introduce Zerobox, a cross-platform, single binary process sandboxing CLI written in Rust. It uses the sandboxing crates from the OpenAI Codex repo and adds additional functionalities like secret injection, SDK, etc.<p>Watch the demo: <a href="https://www.youtube.com/watch?v=wZiPm9BOPCg" rel="nofollow">https://www.youtube.com/watch?v=wZiPm9BOPCg</a><p>Zerobox follows the same sandboxing policy as Deno which is deny by default. The only operation that the command can run is reading files, all writes and network I/O are blocked by default. No VMs, no Docker, no remote servers.<p>Want to block reads to /etc?<p><pre><code> zerobox --deny-read=/etc -- cat /etc/passwd cat: /etc/passwd: Operation not permitted </code></pre> How it works:<p>Zerobox wraps any commands/programs, runs an MITM proxy and uses the native sandboxing solutions on each operating system (e.g BubbleWrap on Linux) to run the given process in a sandbox. The MITM proxy has two jobs: blocking network calls and injecting credentials at the network level.<p>Think of it this way, I want to inject "Bearer OPENAI_API_KEY" but I don't want my sandboxed command to know about it, Zerobox does that by replacing "OPENAI_API_KEY" with a placeholder, then replaces it when the actual outbound network call is made, see this example:<p><pre><code> zerobox --secret OPENAI_API_KEY=$OPENAI_API_KEY --secret-host OPENAI_API_KEY=api.openai.com -- bun agent.ts </code></pre> Zerobox is different than other sandboxing solutions in the sense that it would allow you to easily sandbox any commands locally and it works the same on all platforms. I've been exploring different sandboxing solutions, including Firecracker VMs locally, and this is the closest I was able to get when it comes to sandboxing commands locally.<p>The next thing I'm exploring is `zerobox claude` or `zerobox openclaw` which would wrap the entire agent and preload the correct policy profiles.<p>I'd love to hear your feedback, especially if you are running AI Agents (e.g. OpenClaw), MCPs, AI Tools locally.
https://github.com/afshinm/zerobox
Comments
by: simonw
This looks really good - the CLI interface design is solid, and I especially like the secrets / network proxy pattern - but the thing it needs most is <i>copiously detailed</i> documentation about exactly how the sandbox mechanism works - and how it was tested.<p>There are dozens of projects like this emerging right now. They all share the same challenge: establishing credibility.<p>I'm loathe to spend time evaluating them unless I've seen robust evidence that the architecture is well thought through and the tool has been extensively tested already.<p>My ideal sandbox is one that's been used by hundreds of people in a high-stakes environment already. That's a tall order, but if I'm going to spend time evaluating one the next best thing is documentation that teaches me something about sandboxing and demonstrates to me how competent and thorough the process of building this one has been.<p>UPDATE: On further inspection there's a lot that I like about this one. The CLI design is neat, it builds on a strong underlying library (the OpenAI Codex implementation) and the features it does add - mainly the network proxy being able to modify headers to inject secrets - are genuinely great ideas.
4/1/2026, 6:15:16 PM
by: eluded7
Personally I would probably always reach for a docker container if I want a sandboxed command that can run identically anywhere.<p>I appreciate that alternate sandboxing tools can reduce some of the heavier parts of docker though (i.e. building or downloading the correct image)<p>How would you compare this tool to say bubblewrap <a href="https://github.com/containers/" rel="nofollow">https://github.com/containers/</a>
4/1/2026, 5:45:51 PM
by: mdavid626
I trust sandbox-exec more, or Docker on Linux. Those come from the OS, well tested and known.<p>MITM proxy is nice idea to avoid leaking secrets. Isn’t it very brittle though? Anthropic changes some URL-s and it’ll break.
4/1/2026, 6:34:08 PM
by: volume_tech
the credential injection via MITM proxy is the most interesting part to me. the standard approach for agents is environment variables, which means the agent process can read them directly. having the sandbox intercept network calls and swap in credentials at the proxy layer means the agent code has a placeholder and never sees the real value -- useful when running less-trusted agent code or third-party tools.<p>the deny-by-default network policy also matters specifically for agent use: without it there is nothing stopping a tool call from exfiltrating context window contents to an arbitrary endpoint. most sandboxes focus on filesystem isolation and treat network as an afterthought.
4/1/2026, 6:20:08 PM
by: zephyrwhimsy
Technical debt is not always bad. Deliberate technical debt taken on with eyes open to ship faster is a legitimate business strategy. The problem is accidental technical debt from poor decisions compounding silently.
4/1/2026, 6:17:02 PM
by: time0ut
Very interesting. I just started researching this topic yesterday to build something for adjacent use cases (sandboxing LLM authored programs). My initial prototype is using a wasm based sandbox, but I want something more robust and flexible.<p>Some of my use cases are very latency sensitive. What sort of overhead are you seeing?
4/1/2026, 5:48:20 PM
by: jbverschoor
Again, it’s blacklisting so kind of impossible to get right. I’ve looked at this many times, but in order for things to properly work, you have to create a huge, huge, huge, huge sandbox file.<p>Especially for your application that you any kind of Apple framework.
4/1/2026, 5:58:33 PM
by: wepple
You should probably add a huge disclaimer that this is an untested, experimental project.<p>Related, a direct comparison to other sandboxes and what you offer over those would be nice
4/1/2026, 6:08:49 PM
by: alyxya
Cool project, and I think there would be a lot of value in just logging all operations.
4/1/2026, 5:30:10 PM
by: nonameiguess
This is more a criticism of codex's linux-sandboxing, which you're just wrapping, but it's the first I've ever looked at it. I don't see how it makes sense to invoke bwrap as a forked subprocess. Bubblewrap can't do anything beyond what you can do with unshare directly, which you can simply invoke as a system call without needing to spawn a subprocess or requiring the user to have bwrap installed. It kinds of reeks of amateur hour when developers effectively just translate shell scripts into compiled languages by using whatever variant of "system" is available to make the same command invocations you would make through a shell, as opposed to actually using the system call API. Especially when the invocation is crafted from user input, there's a long history of exploits arising from stuff like this. Writing it in Rust does nothing for you when you're just using Rust to call a different CLI tool that isn't written in Rust.
4/1/2026, 7:06:24 PM
by: gigatexal
there's been so many of these -- which of these sandboxing tools is best?
4/1/2026, 7:25:47 PM
by: MarcelinoGMX3C
[dead]
4/1/2026, 7:28:21 PM
by:
3/31/2026, 5:17:58 AM