skillfed

e2b

E2B SDK that give agents cloud environments

e2b v2.39.1 5.8M downloads/30d#2,034 on PyPI13,404
Permissive license MIT Active released

What it is and what it does

E2B is a Python SDK that lets you spawn and manage isolated cloud sandboxes for executing code that you don't fully trust—typically AI-generated code from language models or user submissions. It abstracts away the complexity of provisioning secure environments and provides a simple API to run shell commands or Python code inside those sandboxes, with results streamed back to your application.

The package is designed for AI agents and applications that need to safely execute untrusted code without risking the host system. It handles the infrastructure side (sandbox provisioning, isolation, cleanup) and exposes a straightforward interface: create a sandbox context, run commands or code, and capture output. The SDK requires an API key from the E2B service and modern Python (3.10+), and pulls in a moderate set of dependencies including httpx for HTTP communication, protobuf for serialization, and rich for output formatting.

Use it for:

  • Run AI-generated code from language models in isolation to prevent malicious or buggy code from affecting your application.
  • Build AI agent systems that need to execute user-submitted scripts or formulas safely in a cloud environment.
  • Test untrusted third-party code or plugins without risking your local machine or production infrastructure.
  • Provide a secure code execution backend for collaborative tools or notebooks where users can run arbitrary Python.
  • Prototype and validate AI-generated solutions (data analysis, automation scripts) before deploying them to production.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

E2B provides a Python SDK to create and control isolated cloud sandboxes for executing untrusted or AI-generated code safely, with support for command execution and code interpretation.

Yes, if you need to execute untrusted or AI-generated code safely. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers low install friction. The main commitment is the E2B API dependency—you'll need to sign up for the service and manage an API key. For applications that don't require remote code execution or sandboxing, it's unnecessary overhead.

Install

e2b on PyPI

pip

pip install e2b

uv

uv add e2b

poetry

poetry add e2b

Installing e2b

Before you install

Low install friction with a pure-Python wheel and 12 runtime dependencies. The project is actively maintained with a recent commit on 2026-08-13 and shows strong community adoption at top_5000 tier.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for most production and research applications.

Quickstart

pip install e2b

from e2b import Sandbox

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

Requires Python >=3.10 and a valid E2B_API_KEY environment variable set with credentials from https://e2b.dev.

Verify before relying

  • Whether the 12 runtime dependencies introduce any transitive security concerns beyond the zero known vulnerabilities in e2b itself.
  • Pricing model and rate limits for sandbox creation and execution time.
  • Performance characteristics and latency for sandbox startup and command execution.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 12 — python-dateutil, wcmatch, protobuf-py, httpx, h2, attrs, packaging, typing-extensions, dockerfile-parse, rich, connectrpc, pyqwest
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 5,805,113/month — #2,034 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: e2b-2.39.1-py3-none-any.whl

Tags

run untrusted code safelycloud sandbox executionai code isolationsecure code environmentremote code interpretersandboxed python executioncloud agent environment
sandbox-executionai-safetycloud-infrastructure

More Distributed Computing packages