gitmyhub

E2B

Python ★ 13k updated 21h ago

Open-source, secure environment with real-world tools for enterprise-grade agents.

E2B provides cloud sandboxes that let AI agents safely run code in isolated temporary environments, a few lines of Python or JavaScript SDK code spin up a sandbox, execute a script, and return the output.

PythonJavaScriptTerraformsetup: moderatecomplexity 3/5

E2B is an open-source infrastructure project that lets AI systems run code safely in the cloud. The core problem it solves is that AI models, like coding assistants or autonomous agents, often need to actually execute code to do useful work, but letting an AI run code directly on a computer is risky. E2B provides isolated sandbox environments, which are temporary, contained virtual computers that spin up in the cloud, run whatever the AI asks, and then shut down cleanly without touching anything else.

Developers use E2B through a software library available in Python or JavaScript. The basic workflow is: create a sandbox, run a command inside it, read back the output, and close it. The whole sequence takes a few lines of code. There is also a separate Code Interpreter extension for use cases where you want to run Python or other code and get structured results back, not just raw text output.

To get started, you install the library, sign up on the E2B website to get an API key, and set that key as an environment variable. The API key authenticates your account so the service knows which sandboxes to bill to you. The sandboxes run on E2B's own cloud infrastructure, so you do not need to set up any servers yourself. Pricing and account management are handled through the E2B dashboard.

For teams that want to host the sandbox infrastructure on their own servers, E2B also publishes a self-hosting guide. It uses Terraform, a tool for setting up cloud resources automatically, and supports both Amazon Web Services and Google Cloud. Azure and general Linux machines are listed as not yet supported.

The project includes a cookbook repository with example code showing how to connect E2B sandboxes to various AI models and agent frameworks.

Where it fits