zerobox 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,242 @@
1
+ <div align="center">
2
+ <h1>🫙 zerobox</h1>
3
+ <p><strong>Run any command in a sandbox. Control what it can read, write, and connect to.</strong></p>
4
+ <p>
5
+ <a href="https://www.npmjs.com/package/zerobox" target="_blank">
6
+ <img src="https://img.shields.io/npm/v/zerobox?style=for-the-badge&labelColor=000000" alt="npm version" />
7
+ </a>
8
+ <a href="https://github.com/afshinm/zerobox/blob/main/LICENSE" target="_blank">
9
+ <img src="https://img.shields.io/github/license/afshinm/zerobox?style=for-the-badge&labelColor=000000" alt="license" />
10
+ </a>
11
+ <a href="https://github.com/afshinm/zerobox/actions/workflows/ci.yml" target="_blank">
12
+ <img src="https://img.shields.io/github/actions/workflow/status/afshinm/zerobox/ci.yml?style=for-the-badge&labelColor=000000&label=CI" alt="CI status" />
13
+ </a>
14
+ </p>
15
+ </div>
16
+
17
+ ## Overview
18
+
19
+ Cross-platform process sandboxing powered by [OpenAI Codex](https://github.com/openai/codex)'s production sandbox runtime. Uses seatbelt on macOS and bubblewrap + seccomp on Linux.
20
+
21
+ - 🔒 **Deny by default.** Writes and network are blocked unless you allow them.
22
+ - 📁 **File access control.** Allow or deny reads and writes to specific paths.
23
+ - 🌐 **Network filtering.** Allow or deny by domain, powered by a real HTTP/SOCKS proxy.
24
+ - 🧩 **TypeScript SDK.** `import { Sandbox } from "zerobox"` with a Deno-style API.
25
+ - 🖥️ **Cross-platform.** macOS, Linux, and Windows.
26
+ - 📦 **Single binary.** No runtime dependencies, no Docker, no VMs.
27
+
28
+ <p align="center">
29
+ <img src="https://raw.githubusercontent.com/afshinm/zerobox/refs/heads/main/packages/zerobox/assets/sandbox-flow.png" alt="zerobox sandbox flow" width="700" />
30
+ </p>
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ # Shell (macOS / Linux)
36
+ curl -fsSL https://raw.githubusercontent.com/afshinm/zerobox/main/install.sh | sh
37
+
38
+ # npm
39
+ npm install -g zerobox
40
+
41
+ # From source
42
+ git clone https://github.com/afshinm/zerobox && cd zerobox
43
+ ./scripts/sync.sh && cargo build --release -p zerobox
44
+ ```
45
+
46
+ ## Quick start
47
+
48
+ ```bash
49
+ # Writes and network are blocked by default
50
+ zerobox -- node -e "console.log('hello')"
51
+
52
+ # Allow writes to a directory
53
+ zerobox --allow-write=. -- node script.js
54
+
55
+ # Allow network to specific domains
56
+ zerobox --allow-net=api.openai.com -- node agent.js
57
+ ```
58
+
59
+ ## Examples
60
+
61
+ ### Run AI-generated code safely
62
+
63
+ An LLM generates code. You need to execute it without risking file corruption, data exfiltration, or network abuse.
64
+
65
+ ```bash
66
+ # LLM writes code to /tmp/task.py. Run it with no writes, no network.
67
+ zerobox -- python3 /tmp/task.py
68
+
69
+ # Allow writes only to an output directory
70
+ zerobox --allow-write=/tmp/output -- python3 /tmp/task.py
71
+
72
+ # Allow the script to call a specific API
73
+ zerobox --allow-write=/tmp/output --allow-net=api.openai.com -- python3 /tmp/task.py
74
+ ```
75
+
76
+ Or via the TypeScript SDK:
77
+
78
+ ```ts
79
+ import { Sandbox } from "zerobox";
80
+
81
+ const sandbox = Sandbox.create({
82
+ allowWrite: ["/tmp/output"],
83
+ allowNet: ["api.openai.com"],
84
+ });
85
+
86
+ const result = await sandbox.sh`python3 /tmp/task.py`.output();
87
+ console.log(result.code, result.stdout);
88
+ ```
89
+
90
+ ### Sandbox a browser agent
91
+
92
+ Use [LightPanda](https://lightpanda.io), a headless browser, for fully sandboxed web browsing. The agent can only reach the domains you allow.
93
+
94
+ ```bash
95
+ # Fetch a page as markdown (only example.com is reachable)
96
+ zerobox --allow-net=example.com -- lightpanda fetch --dump markdown https://example.com
97
+
98
+ # Allow write access for saving results
99
+ zerobox --allow-net=example.com --allow-write=/tmp -- lightpanda fetch --dump html https://example.com
100
+ ```
101
+
102
+ > **Note:** GUI browsers like Chrome and Firefox cannot run inside the sandbox. They require macOS WindowServer access and Unix socket IPC that the sandbox blocks by design. Use a headless engine like LightPanda, or run the browser outside the sandbox and connect via CDP.
103
+
104
+ ### Restrict LLM tool calls
105
+
106
+ Each tool call can be sandboxed individually. The agent runs normally. Only the dangerous operations are sandboxed.
107
+
108
+ ```ts
109
+ import { Sandbox } from "zerobox";
110
+
111
+ // Each tool gets its own sandbox with minimum permissions.
112
+ const reader = Sandbox.create(); // read-only
113
+ const writer = Sandbox.create({ allowWrite: ["/tmp"] }); // writes to /tmp
114
+ const fetcher = Sandbox.create({ allowNet: ["example.com"] }); // one domain
115
+
116
+ // Read a file inside the sandbox
117
+ const data = await reader.js`
118
+ const content = require("fs").readFileSync("/tmp/input.txt", "utf8");
119
+ console.log(JSON.stringify({ content }));
120
+ `.json();
121
+
122
+ // Write a file (only /tmp is writable)
123
+ await writer.js`
124
+ require("fs").writeFileSync("/tmp/output.txt", "result");
125
+ console.log("ok");
126
+ `.text();
127
+
128
+ // Fetch a URL (only example.com is reachable)
129
+ const result = await fetcher.js`
130
+ const res = await fetch("https://example.com");
131
+ console.log(JSON.stringify({ status: res.status }));
132
+ `.json();
133
+ ```
134
+
135
+ Full working examples:
136
+ - [`examples/ai-agent`](examples/ai-agent) -- Vercel AI SDK with sandboxed tools
137
+ - [`examples/workflow`](examples/workflow) -- [Vercel Workflow](https://useworkflow.dev/) with sandboxed durable steps
138
+
139
+ ### Protect your repo during builds
140
+
141
+ Run package installs and build scripts without risking your `.git` history or config files.
142
+
143
+ ```bash
144
+ # npm install can write to node_modules but not .git or .env
145
+ zerobox --allow-write=./node_modules,./package-lock.json --deny-write=./.git,./.env -- npm install
146
+
147
+ # Run a build script with network access for downloading deps
148
+ zerobox --allow-write=./dist --allow-net -- npm run build
149
+
150
+ # Run tests with no network (catch accidental external calls)
151
+ zerobox --allow-write=/tmp -- npm test
152
+ ```
153
+
154
+ ## SDK (TypeScript)
155
+
156
+ ```bash
157
+ npm install zerobox
158
+ ```
159
+
160
+ ```ts
161
+ import { Sandbox } from "zerobox";
162
+
163
+ const sandbox = Sandbox.create({
164
+ allowWrite: ["/tmp"],
165
+ allowNet: ["example.com"],
166
+ });
167
+
168
+ // Shell commands via tagged template
169
+ const output = await sandbox.sh`echo hello`.text();
170
+
171
+ // Parse JSON output
172
+ const data = await sandbox.sh`cat data.json`.json();
173
+
174
+ // Raw output (doesn't throw on non-zero exit)
175
+ const result = await sandbox.sh`exit 42`.output();
176
+ // { code: 42, stdout: "", stderr: "" }
177
+
178
+ // Explicit command + args
179
+ await sandbox.exec("node", ["-e", "console.log('hi')"]).text();
180
+
181
+ // Cancellation
182
+ const controller = new AbortController();
183
+ await sandbox.sh`sleep 60`.text({ signal: controller.signal });
184
+ ```
185
+
186
+ Non-zero exit codes throw `SandboxCommandError`:
187
+
188
+ ```ts
189
+ import { Sandbox, SandboxCommandError } from "zerobox";
190
+
191
+ const sandbox = Sandbox.create();
192
+ try {
193
+ await sandbox.sh`exit 1`.text();
194
+ } catch (e) {
195
+ if (e instanceof SandboxCommandError) {
196
+ console.log(e.code); // 1
197
+ console.log(e.stderr); // error output
198
+ }
199
+ }
200
+ ```
201
+
202
+ ## Performance
203
+
204
+ Sandbox overhead is minimal, typically ~10ms and ~7MB:
205
+
206
+ | Command | Bare | Sandboxed | Overhead | Bare Mem | Sandbox Mem |
207
+ |---------|------|-----------|----------|----------|-------------|
208
+ | `echo hello` | <1ms | 10ms | +10ms | 1.2 MB | 8.4 MB |
209
+ | `node -e '...'` | 10ms | 20ms | +10ms | 39.3 MB | 39.1 MB |
210
+ | `python3 -c '...'` | 10ms | 20ms | +10ms | 12.9 MB | 13.0 MB |
211
+ | `cat 10MB file` | <1ms | 10ms | +10ms | 1.9 MB | 8.4 MB |
212
+ | `curl https://...` | 50ms | 60ms | +10ms | 7.2 MB | 8.4 MB |
213
+
214
+ <sub>Best of 10 runs with warmup, Apple M5 Pro. The ~7MB memory overhead is the sandbox-exec process. For runtimes like Node/Python, the runtime itself dominates memory. Run `./bench/run.sh` to reproduce.</sub>
215
+
216
+ ## Platform support
217
+
218
+ | Platform | Backend | Status |
219
+ |----------|---------|--------|
220
+ | macOS | Seatbelt (`sandbox-exec`) | Fully supported |
221
+ | Linux | Bubblewrap + Seccomp + Namespaces | Fully supported |
222
+ | Windows | Restricted Tokens + ACLs + Firewall | Supported (not yet tested in CI) |
223
+
224
+ ## CLI reference
225
+
226
+ | Flag | Example | Description |
227
+ |------|---------|-------------|
228
+ | `--allow-read <paths>` | `--allow-read=/tmp,/data` | Restrict readable user data to listed paths. System libraries remain accessible. Default: all reads allowed. |
229
+ | `--deny-read <paths>` | `--deny-read=/secret` | Block reading from these paths. Takes precedence over `--allow-read`. |
230
+ | `--allow-write [paths]` | `--allow-write=.` | Allow writing to these paths. Without a value, allows writing everywhere. Default: no writes. |
231
+ | `--deny-write <paths>` | `--deny-write=./.git` | Block writing to these paths. Takes precedence over `--allow-write`. |
232
+ | `--allow-net [domains]` | `--allow-net=example.com` | Allow outbound network. Without a value, allows all domains. Default: no network. |
233
+ | `--deny-net <domains>` | `--deny-net=evil.com` | Block network to these domains. Takes precedence over `--allow-net`. |
234
+ | `-A`, `--allow-all` | `-A` | Grant all permissions. No sandbox enforcement. |
235
+ | `--no-sandbox` | `--no-sandbox` | Disable the sandbox entirely. |
236
+ | `-C <dir>` | `-C /workspace` | Set working directory for the sandboxed command. |
237
+ | `-V`, `--version` | `--version` | Print version. |
238
+ | `-h`, `--help` | `--help` | Print help. |
239
+
240
+ ## License
241
+
242
+ Apache-2.0
package/dist/bin.js CHANGED
@@ -54,9 +54,10 @@ function resolveBinary() {
54
54
  }
55
55
  }
56
56
  console.error("error: zerobox binary not found.\n\n" +
57
- "Install it with one of:\n" +
58
- " cargo install zerobox\n" +
59
- " Set ZEROBOX_BIN=/path/to/zerobox\n");
57
+ "Install the package to get the binary:\n" +
58
+ " npm install zerobox\n\n" +
59
+ "Or set the path manually:\n" +
60
+ " export ZEROBOX_BIN=/path/to/zerobox\n");
60
61
  process.exit(1);
61
62
  }
62
63
  /** Check if a file starts with a Node.js shebang without reading the whole file. */
@@ -83,7 +84,11 @@ try {
83
84
  });
84
85
  }
85
86
  catch (e) {
86
- const status = e.status;
87
- process.exit(status ?? 1);
87
+ const err = e;
88
+ if (err.status != null) {
89
+ process.exit(err.status);
90
+ }
91
+ console.error(`error: ${err.message ?? e}`);
92
+ process.exit(1);
88
93
  }
89
94
  //# sourceMappingURL=bin.js.map
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD,SAAS,aAAa;IACpB,wBAAwB;IACxB,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,4CAA4C;IAC5C,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnD,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC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jB,CAAC,CAAC;AACL,CAAC;AAAC,OAAO,CAAU,EAAE,CAAC;IACpB,MAAM,GAAG,GAAG,CAA0C,CAAC;IACvD,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
package/dist/binary.js CHANGED
@@ -39,7 +39,7 @@ export function verifyBinary() {
39
39
  }
40
40
  catch (e) {
41
41
  if (e.code === "ENOENT") {
42
- throw new Error(`zerobox binary not found at "${bin}". Install it via cargo or set ZEROBOX_BIN.`);
42
+ throw new Error(`zerobox binary not found at "${bin}". Install the package (npm install zerobox) or set ZEROBOX_BIN.`);
43
43
  }
44
44
  // Binary exists but --help failed -- still usable.
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa;IAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC;YACH,MAAM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O,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnD,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;YAChE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YACjC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,YAAY;IAC1B,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,YAAY,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,IAAK,CAA2B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CACb,gCAAgC,GAAG,kEAAkE,CACtG,CAAC;QACJ,CAAC;QACD,mDAAmD;IACrD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerobox",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Run any command in a sandbox with file and network restrictions.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -32,12 +32,12 @@
32
32
  "dist/"
33
33
  ],
34
34
  "optionalDependencies": {
35
- "@zerobox/cli-darwin-x64": "0.1.2",
36
- "@zerobox/cli-darwin-arm64": "0.1.2",
37
- "@zerobox/cli-linux-x64": "0.1.2",
38
- "@zerobox/cli-linux-arm64-musl": "0.1.2",
39
- "@zerobox/cli-linux-arm64": "0.1.2",
40
- "@zerobox/cli-linux-x64-musl": "0.1.2"
35
+ "@zerobox/cli-darwin-arm64": "0.1.4",
36
+ "@zerobox/cli-linux-arm64": "0.1.4",
37
+ "@zerobox/cli-linux-arm64-musl": "0.1.4",
38
+ "@zerobox/cli-linux-x64": "0.1.4",
39
+ "@zerobox/cli-darwin-x64": "0.1.4",
40
+ "@zerobox/cli-linux-x64-musl": "0.1.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.0.0",