FC Agent Sandbox is compatible with the E2B SDK and the E2B CLI. Check the supported APIs, the limited capabilities, and the migration notes before you port an E2B application.
For usage limits, see Usage constraints.
Compatibility overview
|
Capability |
Compatibility status |
Notes |
|
Sandbox |
Partially compatible (pause and resume require allowlist access on the first-generation runtime, not on the second-generation runtime) |
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. FC Agent Sandbox supports custom file metadata only on the second-generation 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 second-generation runtime ( |
|
Volume / Access Token |
Not currently compatible |
Not recommended as the FC Agent Sandbox integration path. Manage teams in the console. |
E2B metrics are supported, and the console provides observability. The Metrics API is not currently supported.
Compatible APIs
Sandbox
On the first-generation runtime, pause and resume are available only to accounts that have been granted allowlist access. Obtain allowlist access before you call sandbox.pause() or connect to a paused sandbox. The second-generation runtime supports pause and resume by default, without allowlist access.
Snapshots are also available only to accounts that have been granted allowlist access, and only on the second-generation runtime (microVM). 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(...), andSandbox.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.
FC Agent Sandbox does not support custom file metadata on the first-generation runtime. For example, in Python SDK e2b==2.31.0, the method signature accepts the metadata parameter, but a sandbox on the first-generation runtime uses envd 0.5.2, and the SDK raises TemplateException: File metadata requires envd 0.6.2 or later instead of sending 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.resultsfield. -
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
languageparameter.
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
FC Agent Sandbox is compatible with the commonly used E2B CLI sandbox commands, and extends some template management commands:
|
Command |
FC Agent Sandbox compatibility status |
Notes |
|
|
Supported |
Creates a sandbox and connects to an interactive terminal. The sandbox is automatically terminated after you exit the terminal. |
|
|
Supported |
Returns running sandboxes by default. Supports |
|
|
Supported |
Supports terminating a sandbox by ID. Also supports |
|
|
Supported |
Connects to an existing sandbox and opens an interactive terminal. Exiting the terminal does not terminate the sandbox. |
|
|
Supported |
Runs a command inside a running sandbox and returns the output to the local terminal. |
|
|
FC Agent Sandbox extension |
Lists the available templates. Output fields may change across versions; run |
New E2B CLI versions authenticate with E2B_API_KEY. For configuration details, see Use FC Agent Sandbox with the CLI.
Metrics
E2B metrics are supported, and the console provides observability. The Metrics API is not currently supported.
Limited capabilities
-
SDK 2.51.0 does not yet support
Sandbox.create()orSandbox.connect(). Use an SDK version earlier than 2.51.0. The officially recommended versions are:Python:
e2b==2.31.0ande2b-code-interpreter==2.8.1Node.js:
e2b@^2.31.0and@e2b/code-interpreter@^2.6.1
Capabilities not currently supported
The following capabilities are not currently part of the FC Agent Sandbox 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 Function Compute 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 FC Agent Sandbox through Extensions (cloud extensions). These capabilities are not native E2B SDK-compatible interfaces.
Extension capabilities
Beyond E2B compatibility, FC Agent Sandbox 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 FC Agent Sandbox: 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-v1and 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.