Skip to main content
A sandbox is an agentic runtime which is an isolated cloud VM under the hood. Sandboxes can start in as little as ~100ms. Each sandbox has its own filesystem, can start processes, and has internet access with configurable firewall. Sandboxes are designed to run thousands of AI agents safely with access to the real-world tools as on your own computer.
import { Sandbox } from '@e2b/code-interpreter'

const sbx = await Sandbox.create()
const result = await sbx.runCode('1 + 1')
console.log(result.text) // 2
await sbx.kill()

Key features

Default configuration

PropertyValue
vCPUs2
RAM2 GiB
Storage22 GiB
InternetEnabled
These are defaults for the code-interpreter template. Custom templates can have different CPU/RAM configurations.
See lifecycle for timeout configuration.

Sandbox capabilities

CapabilityDescription
Run codeExecute Python, JavaScript, R, Java, Bash
FilesystemFull read/write access to isolated filesystem
CommandsRun any shell command or process
InternetOutbound HTTP/HTTPS requests
PersistencePause/resume with full memory state
MetadataAttach custom key-value data
Environment variablesPass secrets and configuration
WebhooksGet notified on lifecycle events
For pricing details, see Billing.