Agent Sandbox Registry

python-sdk

Decision: E2B Compatibility Layer

无中文版

.agents/notes/implemented/feature/2026-09-02-compat-e2b.md

Decision: E2B Compatibility Layer

Status: implemented Implemented: 2026-09-02

Problem

E2B users need a migration path to switch from the official E2B SDK to Agent Sandbox with minimal code changes.

Decision

compat/sandbox.py provides E2B-compatible Sandbox wrapper: - Same method names and signatures as e2b Python SDK - from agent_sandbox.compat import Sandbox as drop-in replacement - Translates E2B-style calls to native Agent Sandbox API calls - Supports E2B environment variables (E2B_API_KEY → SANDBOX_API_KEY)

Compatibility scope: core sandbox lifecycle, process execution, file operations. E2B-specific features not available on Alibaba Cloud raise NotImplementedError with migration guidance.

API Design

# Drop-in replacement for the e2b Python SDK
from agent_sandbox.compat import Sandbox

# Mirrors e2b SDK method names and signatures (create/kill/run/files/...).
# Calls are translated to the native Agent Sandbox API.
# E2B-specific features unavailable on Alibaba Cloud raise NotImplementedError
# with migration guidance.

Implementation

Alternatives considered

Dependencies

Test Strategy

Acceptance criteria