A JavaScript library that embeds a GUI agent in any web page, letting users control the interface with natural language.
e2b-dev/E2B
Open-source infrastructure for running AI-generated code in isolated cloud sandboxes, with JavaScript and Python SDKs.
- Stars
- 14,451
- Forks
- 1,126
- Open issues
- 101
- Last commit
- 2 days ago
What is it?
E2B is open-source infrastructure for running code produced by AI in secure, isolated sandboxes hosted in the cloud. Developers start and control these sandboxes through its JavaScript/TypeScript and Python SDKs, which let an agent run shell commands and work with a filesystem inside an isolated environment.
On top of the core sandbox, separate packages add a Code Interpreter SDK for executing code snippets with a `runCode()` / `run_code()` call that returns outputs, and a Desktop SDK for controlling a virtual desktop through mouse, keyboard, screenshot and application APIs.
The infrastructure can be self-hosted using Terraform on AWS, Google Cloud, Azure, or a general Linux machine.
Key features
- 01Starts isolated cloud sandboxes from JavaScript/TypeScript or Python SDKs.
- 02Runs shell commands and returns stdout from inside a sandbox.
- 03Executes code snippets and returns their outputs via the Code Interpreter SDK.
- 04Controls a virtual desktop with mouse, keyboard, screenshot and app-launch APIs.
- 05Can be self-hosted with Terraform on AWS, GCP, Azure or a generic Linux machine.
Use cases
- Letting an LLM agent run generated code safely without touching the host system.
- Building data analysis or code-interpreter features that execute Python in a sandbox.
- Automating a browser or desktop application for computer-use agents.
- Hosting an isolated execution environment inside your own cloud account.
Quick start
- 1
Install the Python SDK
pip install e2b - 2
Get an E2B API key and set it as an environment variable
- 3
Start a sandbox and run a command
from e2b import Sandbox
Things to know
- Running sandboxes requires an E2B API key and a signup to E2B's hosted service.
- Self-hosting requires deploying the runtime with Terraform on a supported cloud or Linux machine.
Topics
FAQ
- What is E2B?
- Open-source infrastructure for running AI-generated code in isolated cloud sandboxes, with JavaScript and Python SDKs. E2B is open-source infrastructure for running code produced by AI in secure, isolated sandboxes hosted in the cloud. Developers start and control these sandboxes through its JavaScript/TypeScript and Python SDKs, which let an agent run shell commands and work with a filesystem inside an isolated environment.
- Is E2B free to use? What license does it have?
- E2B is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is E2B still maintained?
- Actively maintained. The last commit to E2B was on Oct 19, 2026.
- What can I use E2B for?
- Letting an LLM agent run generated code safely without touching the host system. Building data analysis or code-interpreter features that execute Python in a sandbox. Automating a browser or desktop application for computer-use agents. Hosting an isolated execution environment inside your own cloud account.
- How do I install E2B?
- Install the Python SDK: pip install e2b Get an E2B API key and set it as an environment variable Start a sandbox and run a command: from e2b import Sandbox
- Where can I get E2B?
- The source code and installation instructions are on GitHub: https://github.com/e2b-dev/E2B
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Agent-native memory infrastructure that turns LLM agent conversations and execution into persistent, structured memory for Python and TypeScript apps.
Open-source SDK for building and running AI agents in Python and TypeScript, with tools, MCP, memory, and model portability.
A minimal AI software engineering agent that solves GitHub issues or helps in the command line, using only bash and about 100 lines of core Python.
A secure Python sandbox written in Rust for running code generated by AI, without containers.
An open-source TypeScript framework and app stack for building autonomous AI agents, with a core runtime, plugins, and a local-first Eliza app.