Get started

Get started

Pick one of three routes: the command line, Python code, or let the agent in your IDE call it over MCP. Every command can be copied as is; replace the values in angle brackets and keep secrets out of repositories, logs and chats.

Before you start

An API key for Alibaba Cloud Agent Sandbox Express Edition

The default provider is alicloud-express. Create the key in the Alibaba Cloud console.

Node.js 20+ (CLI and MCP)

Without Node you can download a single-file binary; see the install doc.

Python 3.10+ (Python SDK)

pip install agent-sandbox

  1. Install

    abx is an npm package. Single-file binaries exist for macOS, Linux and Windows.

    shell
    npm install -g @agent-sandbox/cli
    abx --version
  2. Set credentials

    Use an environment variable, or let abx config set write ~/.abx/.env (mode 600). The CLI never reads E2B_API_KEY. The default region is cn-hangzhou.

    shell
    export ABX_SANDBOX_API_KEY="<YOUR_API_KEY>"
    # or keep it on this machine only
    abx config set sandbox_api_key <YOUR_API_KEY>
    abx config set region cn-hangzhou
  3. Create, run, destroy

    base is the default template on Express. abx exec takes the command after --. Destroy when done so it stops using quota.

    shell
    abx create --template base
    abx list
    abx exec <sandbox-id> -- echo hello
    abx kill <sandbox-id> --yes
  4. Move files

    Upload into the sandbox, download the result when it finishes.

    shell
    abx upload <sandbox-id> ./local.txt /home/user/local.txt
    abx download <sandbox-id> /home/user/result.csv ./result.csv
Clean up. Sandboxes use quota for as long as they live. abx list shows everything that is running; abx kill what you no longer need.

Keep reading

Find a template or a provider

The Registry lists public templates and installable providers, each with a capability matrix, its configuration and commands to copy.