Overview
E2B (Emergent) provides secure cloud sandboxes designed for AI agents. Each sandbox is a lightweight VM where LLM-generated code can run safely — install packages, write files, and execute commands without risk to the host system. E2B is the infrastructure layer for autonomous AI coding.
Key Features
- •Instant sandbox creation in under 200ms
- •Python and Node.js runtimes pre-configured
- •Filesystem access for reading and writing files
- •Package installation (pip, npm) within sandboxes
- •Persistent sessions across multiple LLM interactions
- •Simple SDK for integration with any AI framework
Example: Running AI-Generated Code
import { Sandbox } from '@e2b/code-interpreter';
const sandbox = await Sandbox.create();
const result = await sandbox.runCode(`
import pandas as pd
df = pd.DataFrame({'name': ['Alice', 'Bob'], 'score': [95, 87]})
print(df.describe())
`);
console.log(result.text);
await sandbox.close();Use Cases
Code Interpreters
Build ChatGPT-style code interpreters that execute user code safely in isolated sandboxes.
Autonomous Agents
Give AI agents a safe environment to install packages, run scripts, and test their own code.
Data Analysis
Execute data analysis pipelines with pandas, matplotlib, and other Python libraries in sandboxes.