E2B is a free, open source ai development platforms project written in Python and released under Apache-2.0. It has 13,855 GitHub stars, 1,039 forks and 59 open issues, and was last pushed 10 hours ago. On this registry it ranks #44 of 61 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 91 stars over the last 6 tracked days.

E2B — Secure cloud environments for enterprise AI agents

What is E2B?

What it is

E2B is open-source infrastructure that runs AI-generated code in secure isolated cloud sandboxes. It lives in the AI development platform ecosystem for agents, and it provides JavaScript, TypeScript, and Python SDKs for starting and controlling those sandboxes.

The concrete problem E2B solves is the gap between code produced by an AI model and a safe place to execute it. A model can generate a command, a Python snippet, or a browser action, but the application still needs an isolated environment where that action can run without exposing the host system. E2B provides that environment as a cloud sandbox created from application code and controlled through SDK methods.

Key capabilities

  • E2B creates and controls isolated cloud sandboxes through the e2b JavaScript and Python packages.
  • The base SDK can start a sandbox and run shell commands, then return the result and standard output.
  • The Code Interpreter SDK adds runCode() and run_code() for executing code snippets and returning execution text.
  • The Desktop SDK provides mouse, keyboard, screenshot, application, and desktop streaming APIs.
  • E2B supports self-hosting with Terraform on AWS and Google Cloud, and it includes a cookbook with examples for different LLMs and AI frameworks.

Who uses it and how

  • AI agent developers use E2B when a model generates code that must run away from the application process.
  • JavaScript, TypeScript, and Python applications install the e2b package, create a sandbox, and run commands through the SDK.
  • Code interpreter and computer use workflows install the separate Code Interpreter or Desktop package, then execute snippets, launch applications, or capture screenshots.
  • Self-hosters deploy the E2B infrastructure on AWS or Google Cloud with Terraform when they need to operate the sandbox platform themselves.

Getting started

The typical hosted path is to sign up for E2B, obtain an API key, set E2B_API_KEY, and install either npm i e2b or pip install e2b; additional packages are installed with npm i @e2b/code-interpreter or pip install e2b-code-interpreter for code execution, and with npm i @e2b/desktop or pip install e2b-desktop for desktop use. Self-hosting follows the separate self-hosting guide for the E2B infrastructure and uses Terraform.

When to use it — and when not to

Use E2B when an AI application needs a cloud sandbox for generated commands, code snippets, or desktop actions, and when the team can operate the SDKs and API key flow. It is less suitable when a project needs supported self-hosting on Azure or a general Linux machine, because the README lists only AWS and Google Cloud as supported. The project is young and has 59 open issues, so evaluators should test the exact workflows before relying on them in production.

project readme (upstream, from github) — read inline

Last 1 month downloads for the Python SDK Last 1 month downloads for the JavaScript SDK

What is E2B?

E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.

Run your first Sandbox

1. Install SDK

JavaScript / TypeScript

npm i e2b

Python

pip install e2b

2. Get your E2B API key

  1. Sign up to E2B here.
  2. Get your API key here.
  3. Set environment variable with your API key
E2B_API_KEY=e2b_***

3. Start a sandbox and run commands

JavaScript / TypeScript

import Sandbox from 'e2b'

const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout) // Hello from E2B!

Python

from e2b import Sandbox

with Sandbox.create() as sandbox:
    result = sandbox.commands.run('echo "Hello from E2B!"')
    print(result.stdout)  # Hello from E2B!

4. Code execution with Code Interpreter

If you need to execute code with runCode()/run_code(), install the Code Interpreter SDK (JavaScript / Python):

npm i @e2b/code-interpreter  # JavaScript/TypeScript
pip install e2b-code-interpreter  # Python
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()
const execution = await sandbox.runCode('x = 1; x += 1; x')
console.log(execution.text)  // outputs 2

5. Computer use with Desktop

For mouse, keyboard, screenshot, application, and desktop streaming APIs, install the Desktop SDK (JavaScript / Python):

npm i @e2b/desktop  # JavaScript/TypeScript
pip install e2b-desktop  # Python
import { Sandbox } from '@e2b/desktop'

const desktop = await Sandbox.create()
await desktop.launch('google-chrome')
const screenshot = await desktop.screenshot()

6. Check docs

Visit E2B documentation.

7. E2B cookbook

Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.

Self-hosting

Read the self-hosting guide to learn how to set up the E2B infrastructure on your own. The infrastructure is deployed using Terraform.

Supported cloud providers:

  • 🟢 AWS
  • 🟢 Google Cloud (GCP)
  • Azure
  • General Linux machine

Frequently asked questions

Is E2B free to use?

E2B is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does E2B do?

Secure cloud environments for enterprise AI agents

What is E2B written in?

E2B is primarily written in Python. Its source is publicly available at https://github.com/e2b-dev/e2b, and it has 13,855 GitHub stars.