FC Agent Sandbox is a cloud-based isolated runtime for AI agents and code execution workloads. You can create a sandbox on demand to run commands, execute code, read and write files, start temporary services, and release the resources when the task is done.
FC Agent Sandbox is a good fit for workloads that should not run inside your application process, such as executing AI-generated code, running data analysis jobs, invoking complex toolchains, automating scripts, or hosting short-lived web services. Your application is responsible for creating and orchestrating sandboxes, while each sandbox provides an independent runtime that can be disposed of after use.
If you already use E2B, you can keep using the E2B SDK or E2B CLI to connect to FC Agent Sandbox. If this is your first time using the service, start by creating an API key, and then follow Use FC Agent Sandbox with the SDK.
What you can do with FC Agent Sandbox
Run agent tools: Give your agent an isolated runtime for commands, file handling, and tool execution.
Build a code interpreter: Execute Python, Shell, or similar code and return stdout, stderr, text results, or generated files.
Handle short-lived data tasks: Upload data files, then clean, transform, analyze, or report on them inside a sandbox.
Start temporary services: Run HTTP services, development servers, or debug endpoints inside a sandbox and access them through published ports.
Prebuild runtime environments: Preinstall dependencies, language runtimes, and toolchains in templates to reduce per-task startup overhead.
Core objects
Sandbox
A sandbox is an isolated remote execution environment. After your application creates a sandbox, it can run commands, process files, execute code, or start services inside it. When the task is complete, explicitly terminate the sandbox to avoid holding resources longer than necessary.
Template
A template defines the runtime environment used when a sandbox starts. It can include a base image, language runtimes, dependencies, and toolchains. Use a custom template when startup speed, dependency consistency, or tool versions matter.
Commands
Commands let you run processes inside a sandbox. Common use cases include running scripts, starting background services, executing tests, connecting to running processes, and sending standard input.
Filesystem
The filesystem APIs let you manage files inside a sandbox. You can write input files, read result files, manage directories, rename files, or check whether a path exists.
Code Interpreter
Code Interpreter runs code inside a sandbox and is a good fit for data analysis, interactive code execution, and agent-driven code workloads. The most commonly used built-in template is code-interpreter-v1.
Network
Network capabilities let you access ports exposed from a sandbox. When you need to reach a service running inside the sandbox, you can obtain an access URL for a specific port.
Storage
The local sandbox filesystem is designed for data used within the current task. For long-term persistence or data sharing across tasks, use external storage such as NAS or OSS.
FC Extensions
FC Extensions let you integrate FC Agent Sandbox with Alibaba Cloud networking, storage, logging, and monitoring systems. Examples include VPC network configuration, dynamic OSS mounts, log collection, and monitoring alerts. These are FC Agent Sandbox cloud extensions and are not native objects in the E2B SDK.
Basic workflow
Choose a template such as
code-interpreter-v1or a custom template.Create a sandbox.
Write input files, environment variables, or task parameters.
Run commands, execute code, or start a service.
Read stdout, stderr, output files, or the port access URL.
Terminate the sandbox when the task is complete.
Recommended reading path
Read the getting started content in this order:
Start with Create an API Key, then work through Use FC Agent Sandbox with the SDK to launch your first sandbox.
If you want to debug from the command line, see Use FC Agent Sandbox with the CLI.
Before moving to production, read Usage Constraints.
If you are migrating from E2B or need to confirm API boundaries, read E2B Compatibility.
If you need VPC access, OSS integration, logs, or monitoring, read FC Extensions Overview.
After the quickstart, continue with the feature docs for Sandbox, Templates, Commands, Filesystem, Code Interpreter, and Network.