E2B CLI
$ e2b Official Med RiskE2B CLI (@e2b/cli) manages Firecracker microVM sandboxes and custom sandbox templates (e2b.toml) built for executing untrusted AI-generated code. Supports non-interactive E2B_API_KEY auth, e2b sandbox list, e2b sandbox exec, and e2b template create.
brew install e2b e2b CLI handles template builds and sandbox lifecycle management cleanly from CI; E2B's SDK/MCP suits interactive code-interpreter tool calls.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports E2B_API_KEY, sandbox exec, sandbox list, and template build, though lacks universal --json output on list commands.
- Supports
E2B_API_KEYandsandbox exec; lacks--jsonon list
Sandboxes run inside isolated Firecracker microVMs, protecting host machines from untrusted code.
- Hardware-virtualized Firecracker microVM isolation
Available via Homebrew, npm install -g @e2b/cli, and npx @e2b/cli across major OSes.
- Distributed via Homebrew and
@e2b/clion npm
Simplifies custom sandbox image builds (e2b.toml) and live microVM inspection.
- Covers sandbox lifecycle, remote
exec, and template builds
Official e2b-dev/E2B repository under MIT license.
- Official
e2b-dev/E2Brepository
Clear CLI docs at e2b.dev/docs/cli.
- Official docs at e2b.dev/docs/cli
Security, Auth & Guardrails
API key via E2B_API_KEY env var or saved locally after e2b auth login.
CLI is MIT open-source; E2B Cloud includes a free starter credit tier with usage-based microVM billing.
# E2B CLI Agent Rules - Set `E2B_API_KEY` in headless environments instead of `e2b auth login`. - Never invoke `e2b sandbox connect` without a command (it opens an interactive PTY shell); use `e2b sandbox exec`. - Always clean up ephemeral sandboxes with `e2b sandbox kill <id>` to avoid idle billing.
Agent-Ready Command Recipes
Safe Read-Only Queries
e2b sandbox list
Displays running E2B sandboxes, template IDs, and start times.
e2b template list
Enumerates custom and built-in sandbox templates in your team.
Controlled Writes & Previews
e2b sandbox exec <sandbox-id> "python3 --version"
Runs a single command inside an isolated microVM sandbox and returns output.
Strengths for Agents
- + Fast Firecracker microVM isolation for running untrusted AI-generated code.
- +
e2b sandbox execruns non-interactive commands inside live sandboxes. - + Clean
E2B_API_KEYenvironment auth.
Caveats & Pitfalls
- !
sandbox listandtemplate listoutput formatted text tables rather than--json. - !
e2b sandbox connectopens an interactive PTY terminal—prefere2b sandbox exec.