E2B Documentation — Secure Sandboxes for AI Agents
by E2B
Give your agent a real Linux box it can't escape — run model-generated code safely in ~150ms-start VMs.
Overview
E2B provides isolated sandboxes that let agents safely execute code, process data and run tools. The platform rests on two primitives: the Sandbox, a small secure Linux VM created on demand that starts in roughly 150ms, and the Template, which defines the environment a sandbox launches with — base image, preinstalled packages, and configuration. Inside a sandbox an agent can run arbitrary commands and code in multiple languages, read and write files, upload and download data, install third-party packages, and reach the internet, all isolated from your own infrastructure so a hallucinated `rm -rf` or a prompt-injection payload hits a disposable VM instead of production. Python and JavaScript/TypeScript SDKs drive sandbox lifecycle and execution, and the documented use cases span AI data analysis and visualization, running generated code of various languages, playgrounds for coding agents, environments for codegen evals, and hosting full AI-generated applications. The OpenAI Agents SDK integration added in April 2026 makes E2B a documented sandbox option for that stack. Pricing is freemium: the Hobby tier is free with a one-time $100 usage credit, no credit card, sandbox sessions up to one hour and up to 20 concurrent sandboxes; Pro at $150/month adds customizable CPU and RAM, 24-hour sessions and up to 100 concurrent sandboxes (extendable to 1,100); Ultimate is custom enterprise pricing. All tiers bill usage per second of running sandbox time based on CPU, RAM and storage.
At a Glance
- Topic
- Agentic
- Level
- Intermediate
- Format
- Documentation
- Cost
- Freemium
- Duration
- ~1-2 hours to read the quickstart and ship a first sandboxed agent
- Provider
- E2B
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Spin up and tear down isolated Linux sandboxes from Python or JavaScript/TypeScript in about 150ms
- ✓Execute untrusted, model-generated code safely instead of running it on your own servers
- ✓Build custom Templates with preinstalled packages so agents start in a ready environment
- ✓Move files in and out of a sandbox to support data analysis and visualization workflows
- ✓Use sandboxes as reproducible environments for coding-agent evals and CI-style automation
- ✓Manage session limits, concurrency and per-second usage cost across the Hobby, Pro and Ultimate tiers
Highlights
- •~150ms cold start makes per-request sandboxing practical rather than a batch-only tactic
- •Open-source core with a free Hobby tier that includes a one-time $100 usage credit and no credit card
- •Documented integration path with the OpenAI Agents SDK as of April 2026
- •Templates give reproducible environments — the same sandbox definition for dev, prod and evals
Who It’s For
Best For
- ✓Agent developers adding a code-execution or data-analysis tool to an agent
- ✓Teams running coding agents that must not touch production infrastructure
- ✓Engineers building codegen evaluation harnesses that need clean, disposable environments
- ✓Anyone shipping user-facing features that execute LLM-written code
Prerequisites
- •Python or JavaScript/TypeScript experience
- •Basic understanding of LLM tool calling and agent loops
FAQ
What is E2B Documentation — Secure Sandboxes for AI Agents?
Official documentation for E2B, the open-source sandbox infrastructure that runs AI-generated code in isolated cloud VMs. It is for agent developers who need code execution, data analysis or tool use without handing untrusted model output to their own servers.
Is E2B Documentation — Secure Sandboxes for AI Agents free?
E2B Documentation — Secure Sandboxes for AI Agents offers free content, with paid options for certificates or premium features.
What level is E2B Documentation — Secure Sandboxes for AI Agents for?
E2B Documentation — Secure Sandboxes for AI Agents is aimed at a intermediate audience. Recommended background: Python or JavaScript/TypeScript experience, Basic understanding of LLM tool calling and agent loops.
How long does E2B Documentation — Secure Sandboxes for AI Agents take?
Expect roughly ~1-2 hours to read the quickstart and ship a first sandboxed agent. Most learners work through it at their own pace.
What will I learn from E2B Documentation — Secure Sandboxes for AI Agents?
You'll learn: Spin up and tear down isolated Linux sandboxes from Python or JavaScript/TypeScript in about 150ms; Execute untrusted, model-generated code safely instead of running it on your own servers; Build custom Templates with preinstalled packages so agents start in a ready environment; Move files in and out of a sandbox to support data analysis and visualization workflows; Use sandboxes as reproducible environments for coding-agent evals and CI-style automation; Manage session limits, concurrency and per-second usage cost across the Hobby, Pro and Ultimate tiers.