{"by":"afshinmeh","descendants":93,"id":47574871,"kids":[47604487,47762392,47605801,47604394,47605108,47611931,47607742,47605694,47604114,47604140,47606060,47606505,47604258,47604725,47624597,47603903,47605999,47605370,47663708,47606925,47606104,47609530,47753666,47753720,47604552,47605400,47583022,47609814,47604512],"score":141,"text":"I&#x27;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:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=wZiPm9BOPCg\" rel=\"nofollow\">https:&#x2F;&#x2F;www.youtube.com&#x2F;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&#x2F;O are blocked by default. No VMs, no Docker, no remote servers.<p>Want to block reads to &#x2F;etc?<p><pre><code>  zerobox --deny-read=&#x2F;etc -- cat &#x2F;etc&#x2F;passwd\n\n  cat: &#x2F;etc&#x2F;passwd: Operation not permitted\n</code></pre>\nHow it works:<p>Zerobox wraps any commands&#x2F;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 &quot;Bearer OPENAI_API_KEY&quot; but I don&#x27;t want my sandboxed command to know about it, Zerobox does that by replacing &quot;OPENAI_API_KEY&quot; 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\n</code></pre>\nZerobox 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&#x27;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&#x27;m exploring is `zerobox claude` or `zerobox openclaw` which would wrap the entire agent and preload the correct policy profiles.<p>I&#x27;d love to hear your feedback, especially if you are running AI Agents (e.g. OpenClaw), MCPs, AI Tools locally.","time":1774881156,"title":"Show HN: Zerobox – Sandbox any command with file, network, credential controls","type":"story","url":"https://github.com/afshinm/zerobox"}