E2B compatibility

Updated at:

Agent Sandbox Flash Edition is compatible with the E2B SDK and the E2B CLI. Other getting-started topics cover only the minimal integration steps, so use this topic to confirm which E2B interfaces are supported.

For usage limits, see Usage constraints.

Compatibility overview

Capability

Compatibility status

Notes

Sandbox

Partially compatible (SDK 2.51.0 does not yet support create or connect)

Supports create, connect, inspect, timeout configuration, pause, kill, upload and download URLs, and port access URLs. SDK 2.51.0 does not yet support create or connect, so use an SDK version earlier than 2.51.0.

Commands

Compatible

Supports command execution, management of running processes, standard input, and pseudo-terminal (PTY).

Filesystem

Partially compatible

Supports file read and write, directory management, rename, delete, existence checks, and directory watching. Agent Sandbox Flash Edition supports custom file metadata only on the MicroVM runtime.

Code Interpreter

Compatible

Supports code execution, context management, execution outputs, streaming output, and state persistence across multiple runs. Charts can be retrieved only as generated files, through Filesystem or download URLs.

Template

Compatible

Supports template create, read, update, and delete operations, and can build templates from images.

CLI

Partially compatible

Supports the commonly used sandbox and template commands.

Network Config Update

Compatible

Supports updating the network configuration of a running sandbox.

Snapshots

Compatible (requires allowlist access)

Supports creating, listing, and deleting snapshots, and restoring a sandbox from a snapshot ID or qualified name. Available only on the MicroVM runtime; retained for 7 days by default from creation. For usage notes, see Snapshot (Preview).

Volume / Access Token

Not currently compatible

Not recommended as the Agent Sandbox Flash Edition integration path. Manage teams in the console.

Note

E2B metrics are supported, and the console provides observability. The Metrics API is not currently supported.

Compatible APIs

Sandbox

The Snapshot feature is available only on the MicroVM runtime and only to accounts that have been granted allowlist access. Obtain allowlist access before you call Snapshot-related APIs.

The following sandbox lifecycle and access capabilities are supported:

  • Sandbox.create()

  • Sandbox.connect(sandboxId)

  • Sandbox.list()

  • Sandbox.getInfo(sandboxId)

  • Sandbox.kill(sandboxId)

  • Sandbox.setTimeout(sandboxId, ms)

  • sandbox.getInfo()

  • sandbox.isRunning()

  • sandbox.setTimeout(ms)

  • sandbox.pause()

  • sandbox.kill()

  • sandbox.downloadUrl(path)

  • sandbox.uploadUrl(path)

  • sandbox.getHost(port)

  • sandbox.createSnapshot({ name? }) / Sandbox.createSnapshot(sandboxId, { name? })

  • Sandbox.listSnapshots({ sandboxId?, name?, limit?, nextToken? })

  • Sandbox.deleteSnapshot(snapshotId | qualifiedName)

  • Python: sandbox.create_snapshot(name=...) / Sandbox.create_snapshot(sandbox_id, name=...), Sandbox.list_snapshots(...), and Sandbox.delete_snapshot(snapshot_id | qualified_name)

Sandbox.connect(sandboxId) can connect to an existing sandbox. If the target sandbox is paused, connecting automatically resumes it.

Sandbox.create() accepts a snapshot ID or the qualified name of a named snapshot as its template parameter, in addition to a template name or template ID. For snapshot usage limits and naming rules, see Snapshot (Preview).

Commands

The following command execution and process management capabilities are supported:

  • sandbox.commands.run()

  • sandbox.commands.list()

  • sandbox.commands.connect()

  • sandbox.commands.sendStdin()

  • sandbox.commands.kill()

Interactive terminals and tasks that depend on a teletypewriter (TTY) use the sandbox.pty API.

Filesystem

The following filesystem capabilities are supported:

  • sandbox.files.list()

  • sandbox.files.exists()

  • sandbox.files.getInfo() / sandbox.files.get_info()

  • sandbox.files.read()

  • sandbox.files.write()

  • sandbox.files.makeDir() / sandbox.files.make_dir()

  • sandbox.files.remove()

  • sandbox.files.rename()

  • sandbox.files.watchDir() / sandbox.files.watch_dir()

sandbox.files.write() supports text, binary, and streaming content. Directory watching is useful for waiting for agent output files or syncing task artifacts.

Agent Sandbox Flash Edition supports custom file metadata only on the MicroVM runtime. For example, in Python SDK e2b==2.31.0, the method signature accepts the metadata parameter, but the sandbox envd version must be 0.6.2 or later. If the envd version is earlier than 0.6.2, the SDK raises TemplateException: File metadata requires envd 0.6.2 or later before it sends the write request.

Code Interpreter

The core Code Interpreter capabilities are supported:

  • sandbox.runCode() / sandbox.run_code()

  • sandbox.createCodeContext() / sandbox.create_code_context()

  • sandbox.listCodeContexts() / sandbox.list_code_contexts()

  • sandbox.restartCodeContext() / sandbox.restart_code_context()

  • sandbox.removeCodeContext() / sandbox.remove_code_context()

  • Execution outputs, including stdout, stderr, execution count, the results of bare expressions, and rich results from the execution.results field.

  • stdout, stderr, and result callbacks when output is streamed.

  • Variable and context state persistence across multiple code executions.

  • Python, JavaScript, TypeScript, and Bash execution through the language parameter.

Charts and visualizations currently support only the file-based fallback: generate image files inside the sandbox, then retrieve them through Filesystem or download URLs.

Template

Create, read, update, and delete (CRUD) operations on templates are supported. Template building currently supports creating templates from images. For details, see Build and manage templates.

CLI

Agent Sandbox Flash Edition is compatible with the commonly used E2B CLI sandbox commands, and extends some template management commands:

Command

Agent Sandbox Flash Edition compatibility status

Notes

sandbox create <template>

Supported

Creates a sandbox and connects to an interactive terminal. The sandbox is automatically terminated after you exit the terminal.

sandbox list

Supported

Returns running sandboxes by default. Supports --state, --metadata, --limit, and --format.

sandbox kill

Supported

Supports terminating a sandbox by ID. Also supports --all for bulk termination.

sandbox connect

Supported

Connects to an existing sandbox and opens an interactive terminal. Exiting the terminal does not terminate the sandbox.

sandbox exec

Supported

Runs a command inside a running sandbox and returns the output to the local terminal.

template list

Agent Sandbox Flash Edition extension

Lists the templates available in Agent Sandbox Flash Edition. This command is an extension beyond the native E2B CLI, and its output fields may change across versions. Run template list --help to view the specific parameters.

New E2B CLI versions authenticate with E2B_API_KEY. For configuration details, see Use Agent Sandbox Flash Edition with the CLI.

Metrics

E2B metrics are supported, and the console provides observability. The Metrics API is not currently supported.

Limited capabilities

  • The latest SDK release, 2.51.0, does not yet support Sandbox.create() or Sandbox.connect() . Use an SDK version earlier than 2.51.0. The officially recommended versions are:

    Python: e2b==2.31.0 and e2b-code-interpreter==2.8.1

    Node.js: e2b@^2.31.0 and @e2b/code-interpreter@^2.6.1

Capabilities not currently supported

The following capabilities are not currently part of the Agent Sandbox Flash Edition E2B-compatible primary integration path:

  • Volume API.

  • Team management (manage teams in the console).

  • API key and access token management.

If you need persistent storage or cloud data access, use Alibaba Cloud storage services such as Apsara File Storage NAS or Object Storage Service (OSS) first. To preserve sandbox runtime state, use Snapshot (Preview). Create and manage API keys in the Agent Sandbox console, not through the E2B SDK. For details, see Create an API Key.

Capabilities such as virtual private cloud (VPC) access, OSS integration, log collection, and monitoring alerts are provided by Agent Sandbox Flash Edition through Extensions (cloud extensions). These capabilities are not native E2B SDK-compatible interfaces.

Extension capabilities

Beyond E2B compatibility, Agent Sandbox Flash Edition also provides extra capabilities through Extensions (cloud extensions), which connect to Function Compute and Alibaba Cloud infrastructure. These capabilities do not change the basic usage of the E2B SDK or CLI. The following capabilities are available:

  • Extensions overview : an overview of the extension capabilities and the entry point to each sub-capability.

  • VPC network configuration: lets a sandbox access resources in your VPC, such as ApsaraDB RDS, ApsaraDB for Redis, NAS, and internal APIs.

  • Custom domains for Agent Sandbox Flash Edition: access services in a sandbox through your own fixed domain name and certificate.

  • Dynamic OSS Mounts: mount an OSS bucket or subdirectory to a local directory inside a sandbox when the sandbox is created.

  • Monitoring and logs: view the running status and resource usage of a sandbox, and collect stdout and stderr logs to Simple Log Service.

  • Team quota management: set CPU and memory resource quotas per team to achieve resource isolation and cost control.

  • Create an OSS Volume: save the mount configuration of an existing OSS bucket so that sandboxes can mount it by volume name when they are created.

  • Create an AgenticFS Volume: save the mount configuration of an existing AgenticFS access point so that sandboxes can mount it by volume name when they are created.

Migration recommendations

  • If you already have an E2B-based application, keep the SDK call pattern unchanged and replace only the API key, API URL, and domain.

  • Start with code-interpreter-v1 and a minimal sandbox example to verify sandbox creation, command execution, file read and write, and resource cleanup.

  • If your application depends on the Metrics API, Logs, or Volume, adjust the design before migration instead of following the original E2B path directly. Snapshots are supported, but their naming, deletion paths, and restore constraints are not exactly the same as those in official E2B. Before migrating, read Snapshot (Preview).

  • In production code, call sandbox.kill() explicitly to prevent a sandbox from holding resources longer than needed.

Related documents