This release is a pre-release and may not be stable for production use.
agent-sandbox-client
Provider extensions use whole-template startup (中文); application HTTP, stateless execution and context operations are independent.
The commands below select the 0.5.0a1 preview. See releases for availability and the installation guide for setup and migration from 0.4 previews.
Client SDK. The product is Agent Sandbox. The import path is agent_sandbox. This package runs on your machine: create a sandbox, use it, and kill it. The HTTP service inside the image is agent-sandbox-server. Guide: Client SDK.
Prepare template images with abx template build; deploy applications with abx deploy <reference> --name <name>.
The standard root Sandbox/AsyncSandbox and code_interpreter APIs follow Alibaba-supported E2B behavior: migration guide (中文). Provider/server/declarative extensions use the explicit ProviderSandbox entry.
This package is the agent_sandbox import namespace except agent_sandbox.server, which is
the container-side runtime shipped separately as
agent-sandbox-server (available through the optional [server] extra, pinned to the same version).
Standard clients, ProviderSandbox, ServerClient and @sandbox(...) do not require
a local server runtime. Local @sandbox.register and sandbox.server require the
server extra; [all] and [dev] include it.
The command-line tool (abx) is a separate Node.js project that lives in the cli repository.
Install
python -m pip install --index-url https://pypi.org/simple 'agent-sandbox-client==0.5.0a1'
# Optional extras:
python -m pip install --index-url https://pypi.org/simple 'agent-sandbox-client[all]==0.5.0a1'
python -m pip check
Do not run pip install agent-sandbox. That name on PyPI is an unrelated project.
Quick start
Configure the Express API key before this example. It uses standard command and file APIs; provider-specific interpreters and registered server commands have separate requirements.
import asyncio
from agent_sandbox import AsyncSandbox
async def main():
sandbox = await AsyncSandbox.create(template="base")
try:
result = await sandbox.commands.run("echo hello")
print(result.stdout)
await sandbox.files.write("/tmp/data.txt", "content")
print(await sandbox.files.read("/tmp/data.txt"))
finally:
await sandbox.kill()
asyncio.run(main())
Provider management operations use agent_sandbox.providers.commands; see the
English guide and
中文指南. Writes require explicit confirmation,
and command POST requests are never automatically replayed.
Layout
| Package | Layer |
|---|---|
agent_sandbox.transport |
L1 — HTTP/2, WebSocket, API key / AK-SK auth, config loading |
agent_sandbox.protocol |
L2 — envd protocol (sandbox, process, filesystem, terminal, port) |
agent_sandbox.api |
L3 — Sandbox, files, commands, code, named commands, server client |
agent_sandbox.declarative |
L4 — @sandbox decorator, sandbox.yaml |
agent_sandbox.agent |
L5 — tool schemas, MCP stdio/HTTP servers |
Run the MCP stdio server directly with python -m agent_sandbox.agent.mcp
(reads ABX_SANDBOX_API_KEY, ABX_SANDBOX_BASE_URL, ABX_SANDBOX_DOMAIN and ABX_DEFAULT_TEMPLATE).
Named-command string-array arguments (list[str]) preserve native JSON values. See the server API guide.
Develop
# from python-sdk/
pip install -e ./server-sdk -e "./client-sdk[dev]"
cd client-sdk && pytest -m "not integration" && ruff check src tests && mypy src/agent_sandbox
Licensed under Apache-2.0.
Managed per-Session Agents API deployment: English guide / 中文指南.
Metadata
Release files for agent-sandbox-client 0.5.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_sandbox_client-0.5.0a1.tar.gz | 708.8 kB | Without provenance | Details for agent_sandbox_client-0.5.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_sandbox_client-0.5.0a1-py3-none-any.whl | Python 3 | none | any | Details for agent_sandbox_client-0.5.0a1-py3-none-any.whl |
Total release size: 1.4 MB
Release files / agent_sandbox_client-0.5.0a1.tar.gz
| Download URL | agent_sandbox_client-0.5.0a1.tar.gz |
|---|---|
| Size | 708.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d69c6f7bd9b7737274a7ebd8615317b53e543955eb1bebc7e22fbc98e0999e1
|
|
BLAKE2b-256 checksum How to use checksums |
8c823d29baaeadb3756a934bede107c88147bb5b152c98d48a2a8b49db76fbc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / agent_sandbox_client-0.5.0a1-py3-none-any.whl
| Download URL | agent_sandbox_client-0.5.0a1-py3-none-any.whl |
|---|---|
| Size | 692.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d5633797e164ba0cf4783b4245abc458d731233271de9e723bd5771f87d0b4f
|
|
BLAKE2b-256 checksum How to use checksums |
f44dccb82cf29332f5e06ec0314aedda83f7e879a042dbc6f8c918cd3f74c5e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for agent-sandbox-client 0.5.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.