E2B
Open-source, secure environment with real-world tools for enterprise-grade agents.
What is E2B?
Open-source, secure environment with real-world tools for enterprise-grade agents.
Overview of E2B
What it is
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. It provides JavaScript and Python SDKs to start and control sandboxes.
Key features
- Secure isolated sandboxes for running AI-generated code
- JavaScript/TypeScript SDK (
e2bpackage) and Python SDK (e2bpackage) - Code Interpreter SDK for executing code with
runCode()/run_code() - Desktop SDK for mouse, keyboard, screenshot, application, and desktop streaming APIs
- Self-hosting support via Terraform on AWS, Google Cloud, Azure, and general Linux machines
Use cases
- Enterprise-grade agents that need secure execution environments
- Running AI-generated code in isolated sandboxes
- Code interpretation and execution with AI frameworks
- Desktop automation and computer use for AI agents
Getting started
Install the SDK:
npm i e2b
or
pip install e2b
Get your E2B API key and set the environment variable E2B_API_KEY. Then start a sandbox and run commands:
import Sandbox from 'e2b'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout)
For code execution, install @e2b/code-interpreter or e2b-code-interpreter. For desktop APIs, install @e2b/desktop or e2b-desktop. See the repository README for full details.
License and pricing
The project is licensed under Apache-2.0 and is open-source.
Based on the project's public README and repository metadata.