agent-sandbox
A secure, embeddable, WASM-based sandbox for AI agents. 40+ built-in CLI tools, <13ms startup, no Docker/VMs required.
Installation
Rust
Node.js
Prebuilt binaries are available for macOS (arm64, x64), Linux (x64, arm64), and Windows (x64).
Quick Start
Rust
use ;
let config = SandboxConfig ;
let sandbox = new?;
let result = sandbox.exec.await?;
println!;
Node.js
import from "@parassharmaa/agent-sandbox";
const sandbox = ;
const result = await sandbox.;
console.log;
const changes = await sandbox.;
await sandbox.;
Features
- 40+ tools: cat, grep, find, sed, awk, jq, git, tar, zip, and more
- Filesystem sandboxing with path traversal prevention
- Resource limits: fuel, timeout, memory
- Change tracking via filesystem snapshots
- AOT precompiled WASM — <13ms cold start, ~55µs cached
- Node.js bindings (NAPI)
Limitations
- No network access (WASI p1)
- No process spawning or shell pipes
- Built-in tools only — can't run Python/Node/Ruby
- Single-threaded execution
- Same-architecture precompiled binary
Best for: file-manipulation agents (code analysis, refactoring, git ops). Not for: arbitrary script execution, API calls, databases, GPU.
License
MIT