freshcrate
Skin:/
Home > Security > E2B

E2B

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

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

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

README

E2B SDK Preview E2B SDK Preview

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:

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. Check docs

Visit E2B documentation.

6. 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

Release History

VersionChangesUrgencyDate
e2b@2.28.0### Minor Changes - 073661a: Add API-only custom header options for the JavaScript and Python SDKs. ### Patch Changes - e7a82ea: Remove unused internal code: `wait` helper (js-sdk), `asSandboxTemplate`/`asHeadline`/`selectOption`/`basicDockerfile` (cli), and `format_execution_timeout_error` (python-sdk). No public API changes. - 5b2bb94: Return a dedicated rate limit error for HTTP 429 responses from the envd API. Previously these were surfaced as a generic sandbox error, unlike the main API High6/6/2026
@e2b/python-sdk@2.25.1### Patch Changes - 4b9cc04: Use the stable sandbox host for envd requests on supported E2B domains and give envd traffic a separate HTTP transport cache from API traffic. Sync envd transports are cached per thread to avoid sharing a single HTTP/2 connection across threaded sync workloads. High5/29/2026
@e2b/cli@2.10.2### Patch Changes - 6d66d15: Fix `e2b auth login` crashing on headless machines where `xdg-open` is unavailable. The CLI now spawns the browser opener directly so it can catch the spawn `ENOENT` synchronously, prints the login URL so the user can open it manually, and suggests setting `E2B_API_KEY` when interactive login is not possible. High5/22/2026
e2b@2.21.0### Minor Changes - 2ac5de2: Add `signal: AbortSignal` option to JS SDK methods to support cancelling in-flight requests. The signal can be passed to `Sandbox.create`, `Sandbox.connect`, `sandbox.commands.run`, `sandbox.files.*`, volume methods, and other request options. When the signal is aborted, the underlying `fetch` is aborted and the returned promise rejects with an `AbortError`. `SandboxPaginator.nextItems` and `SnapshotPaginator.nextItems` now accept a `SandboxApiOpts` argument High5/18/2026
e2b@2.20.1### Patch Changes - eaf452a: add optional name parameter to createSnapshot and return snapshot names High5/14/2026
e2b@2.20.0### Minor Changes - b2a2786: Compatibility for turbopack High5/11/2026
e2b@2.19.5### Patch Changes - f7a97e6: Use HTTP/2 for JS SDK envd/api requests and require Node.js 20.18.1 or newer. High5/6/2026
e2b@2.19.4### Patch Changes - ae13876: drop unused `npm-check-updates` devDependency to clear remaining `tar@6` Dependabot security alerts High4/30/2026
e2b@2.19.2### Patch Changes - 2c995d4: added opt-in `useOctetStream` / `use_octet_stream` option to sandbox file write; default is now `multipart/form-data` regardless of envd version High4/27/2026
e2b@2.19.1### Patch Changes - 3167e19: fix(js-sdk): buffer template tar archive before upload so `fetch` sets `Content-Length` instead of falling back to `Transfer-Encoding: chunked`. S3 presigned PUT URLs reject chunked requests with `501 NotImplemented`, breaking template uploads in self-hosted deployments backed by S3-compatible storage. Aligns the JS SDK with the Python SDK, which already buffers via `io.BytesIO`. - 2f0ff5f: fix(sdk): prevent shell injection in MCP config by using proper shell esHigh4/24/2026
@e2b/python-sdk@2.20.0### Minor Changes - cf35f61: switch to application/octet-stream for file uploads - 1cc385a: Edit README ### Patch Changes - ef46004: Increase default timeout for volume file uploads to 1 hour High4/2/2026
e2b@2.19.0### Minor Changes - cf35f61: switch to application/octet-stream for file uploads - 1cc385a: Edit README ### Patch Changes - ef46004: Increase default timeout for volume file uploads to 1 hour Medium4/2/2026
@e2b/python-sdk@2.19.0### Minor Changes - 6d7e72e: added volumes support to the SDKs Medium3/26/2026
e2b@2.18.0### Minor Changes - 6d7e72e: added volumes support to the SDKs Medium3/26/2026
e2b@2.17.0### Minor Changes - f7f1f29: Update SDK READMEs Medium3/25/2026
@e2b/python-sdk@2.18.0### Minor Changes - f7f1f29: Update SDK READMEs Medium3/25/2026
@e2b/cli@2.9.0### Minor Changes - dcaca73: cli supports info command which is the equivilent of the getInfo ### Patch Changes - Updated dependencies [1c55083] - Updated dependencies [7c8d298] - e2b@2.16.0 Medium3/23/2026
e2b@2.16.0### Minor Changes - 7c8d298: adds network configs and lifecycle handling to info responses ### Patch Changes - 1c55083: Fix missing instance config propagation in Sandbox pause/connect and add regression tests for config forwarding + overrides. Medium3/23/2026
@e2b/python-sdk@2.17.0### Minor Changes - 7c8d298: adds network configs and lifecycle handling to info responses ### Patch Changes - 1c55083: Fix missing instance config propagation in Sandbox pause/connect and add regression tests for config forwarding + overrides. Medium3/23/2026
@e2b/python-sdk@2.16.0### Minor Changes - ca85620: Add `fixMissing` / `fix_missing` option to `aptInstall` / `apt_install` to support the `--fix-missing` flag in apt-get install ### Patch Changes - 5a673d1: chore: distinguish between Sandbox and file not found Medium3/23/2026
e2b@2.15.0### Minor Changes - ca85620: Add `fixMissing` / `fix_missing` option to `aptInstall` / `apt_install` to support the `--fix-missing` flag in apt-get install ### Patch Changes - 5a673d1: chore: distinguish between Sandbox and file not found Medium3/23/2026
@e2b/cli@2.8.2### Patch Changes - ba7caa5: Fix update notifier not displaying by replacing update-notifier with simple-update-notifier - 8abfa62: fix(cli): use `name` parameter instead of deprecated `alias` in template init generated code - Updated dependencies [ca85620] - Updated dependencies [5a673d1] - e2b@2.15.0 Medium3/23/2026
@e2b/python-sdk@2.15.3### Patch Changes - 710fae6: request_timeout applies to connect/pool/write Low3/18/2026
@e2b/python-sdk@2.15.2### Patch Changes - 16c86d1: Support multiple asyncio loops Low3/9/2026
@e2b/cli@2.8.1### Patch Changes - b0ab7f7: Add implicit limit for sandbox list query to CLI Low3/9/2026
@e2b/python-sdk@2.15.1### Patch Changes - 222105d: include .dot files in template file upload Low3/6/2026
e2b@2.14.1### Patch Changes - 222105d: include .dot files in template file upload - 3c56842: fix: pass sandbox headers to EnvdApiClient Low3/6/2026
e2b@2.14.0### Minor Changes - 7027f36: Adds lifecycle prop to control pausing and auto-resume Low3/4/2026
@e2b/python-sdk@2.15.0### Minor Changes - 7027f36: Adds lifecycle prop to control pausing and auto-resume Low3/4/2026
e2b@2.13.1### Patch Changes - e83cf86: Add `getTags`/`get_tags` method to list all tags for a template Low3/4/2026
@e2b/python-sdk@2.14.1### Patch Changes - 6371d0c: Fix sandbox not found error message in set_timeout - e83cf86: Add `getTags`/`get_tags` method to list all tags for a template Low3/4/2026
@e2b/cli@2.8.0### Minor Changes - bcc6ea8: Add `pause` and `resume` commands to manage sandbox state. - `e2b sandbox pause <sandboxID>` - pause a running sandbox - `e2b sandbox resume <sandboxID>` - resume a paused sandbox ### Patch Changes - Updated dependencies [e83cf86] - e2b@2.13.1 Low3/4/2026
@e2b/cli@2.7.3### Patch Changes - b989b29: fix crash on invalid status codes in error handler Low2/26/2026
@e2b/cli@2.7.2### Patch Changes - 6c1db7d: fix issue with pagination on listSandboxes Low2/25/2026
@e2b/python-sdk@2.14.0### Minor Changes - a55ca21: Add snapshot API for creating persistent sandbox snapshots Low2/24/2026
e2b@2.13.0### Minor Changes - a55ca21: Add snapshot API for creating persistent sandbox snapshots Low2/24/2026
@e2b/cli@2.7.1### Patch Changes - a2cd86c: added -d option to create sandbox in detached mode - 8f53fdc: set default template to spawn command - a26e213: Print Sandbox Inspect url for E2B Dashboard Inspection Low2/21/2026
@e2b/python-sdk@2.13.3### Patch Changes - c38a181: fixes type errors when using with ty Low2/21/2026
@e2b/cli@2.7.0### Minor Changes - 87ceec2: Implement closeStdin to allow piping commands into the CLI Low2/12/2026
@e2b/cli@2.6.1### Patch Changes - 575d5bc: Fix CLI team ID resolution when E2B_API_KEY is set via environment variable. Add E2B_TEAM_ID env var support. Previously, the CLI always used the team ID from ~/.e2b/config.json, causing "Team ID param mismatch" errors when the API key belonged to a different team. Low2/9/2026
@e2b/python-sdk@2.13.2### Patch Changes - 6395a5f: Fix type checker compatibility for class_method_variant descriptor Low2/9/2026
e2b@2.12.1### Patch Changes - 8efc53c: Use chunked transfer encoding for tar uploads to reduce memory usage - 5e9c6d6: fix: validate copy src paths are relative and within context directory - 1780a0c: Fix error handling for API responses with empty body. Low2/9/2026
@e2b/python-sdk@2.13.1### Patch Changes - 5e9c6d6: fix: validate copy src paths are relative and within context directory - 1a8fed0: Consolidate logic on the git functionality and tests to ensure parity on sync/async functionality Low2/9/2026
e2b@2.12.0### Minor Changes - 77b08f5: Adds first class support to git commands to the sandbox sdk. Low1/29/2026
@e2b/python-sdk@2.13.0### Minor Changes - 77b08f5: Adds first class support to git commands to the sandbox sdk. Low1/29/2026
@e2b/python-sdk@2.12.2### Patch Changes - 4af9b4c: avoid reading files on upload Low1/29/2026
@e2b/cli@2.6.0### Minor Changes - 631522d: Use v2 template update endpoint and display namespaced template name after publishing ### Patch Changes - Updated dependencies [631522d] - Updated dependencies [4af9b4c] - e2b@2.11.2 Low1/29/2026
e2b@2.11.2### Patch Changes - 631522d: Add v2 template update endpoint with TemplateUpdateResponse containing namespaced names - 4af9b4c: avoid reading files on upload Low1/29/2026
@e2b/python-sdk@2.12.1### Patch Changes - 07ef17f: deprecate aliasexists and add exists Low1/27/2026
e2b@2.11.1### Patch Changes - 07ef17f: deprecate aliasexists and add exists Low1/27/2026
@e2b/cli@2.5.1### Patch Changes - 10abab8: Update templates to use new `Template.build()` format - Updated dependencies [10abab8] - e2b@2.11.0 Low1/27/2026
@e2b/python-sdk@2.12.0### Minor Changes - 10abab8: Add template versioning with tags support - `Template.build()` now accepts names in `name:tag` format (e.g., `"my-template:v1.0"`) - New `Template.assignTags()` / `Template.assign_tags()` to assign tags to existing builds - New `Template.removeTags()` / `Template.remove_tags()` to remove tags Low1/27/2026
e2b@2.11.0### Minor Changes - 10abab8: Add template versioning with tags support - `Template.build()` now accepts names in `name:tag` format (e.g., `"my-template:v1.0"`) - New `Template.assignTags()` / `Template.assign_tags()` to assign tags to existing builds - New `Template.removeTags()` / `Template.remove_tags()` to remove tags Low1/27/2026
e2b@2.10.5### Patch Changes - 1c5cf95: Use portable mode for deterministic gzip output Low1/26/2026
@e2b/python-sdk@2.11.0### Minor Changes - ae48a0a: Drop support for Python 3.9 Low1/26/2026
e2b@2.10.4### Patch Changes - c1ee183: Add writeFiles function to sync with Python SDK Low1/23/2026
@e2b/cli@2.5.0### Minor Changes - 4ebabfe: Add exec command Low1/22/2026
e2b@2.10.3### Patch Changes - 5fd71a2: Add user-agent header to EnvdApiClient Low1/20/2026
e2b@2.10.2### Patch Changes - a8e5201: fix float timeout to int conversion for Go backend compatibility - ab906ad: fix: adjust timestamp conversion to remove milliseconds Low1/15/2026
@e2b/python-sdk@2.10.2### Patch Changes - ab906ad: fix:timestamp conversion for metric endpoints Low1/15/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

Secure-Agent-LauncherBlock AI agent access to sensitive macOS paths and log all actions to protect private data during command execution.main@2026-06-03
mcp-audit🌟 Track token consumption in real-time with MCP Audit. Diagnose context bloat and unexpected spikes across MCP servers and tools efficiently.main@2026-06-06
deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of tamain@2026-06-06
hermes-agentThe agent that grows with youv2026.6.5
OpenSandboxSecure, Fast, and Extensible Sandbox runtime for AI agents.docker/egress/v1.0.13

More in Security

clineAutonomous coding agent right in your IDE, capable of creating/editing files, executing commands, using the browser, and more with your permission every step of the way.
OpenSandboxSecure, Fast, and Extensible Sandbox runtime for AI agents.
vm0the easiest way to run natural language-described workflows automatically
agentfieldFramework for AI Backend. Build and run AI agents like microservices - scalable, observable, and identity-aware from day one.