Agent Sandbox Registry

python-sdk

Decision: Platform API Protocol (L2)

无中文版

.agents/notes/implemented/feature/2026-09-02-protocol-sandbox.md

Decision: Platform API Protocol (L2)

Status: implemented Implemented: 2026-09-02

Problem

Need typed wrappers for sandbox lifecycle REST API (create, list, get info, kill, set timeout).

Decision

protocol/sandbox.py wraps Platform API endpoints as async functions: - create_sandbox(template, timeout, metadata, env_vars) → SandboxInfo - list_sandboxes() → list[SandboxInfo] - get_sandbox_info(sandbox_id) → SandboxInfo - kill_sandbox(sandbox_id) → None - set_timeout(sandbox_id, timeout) → None

All functions use Platform API with X-API-KEY authentication (standard REST, JSON body).

API Design

async def create_sandbox(template: str, timeout: int, metadata: dict, env_vars: dict) -> SandboxInfo: ...
async def list_sandboxes() -> list[SandboxInfo]: ...
async def get_sandbox_info(sandbox_id: str) -> SandboxInfo: ...
async def kill_sandbox(sandbox_id: str) -> None: ...
async def set_timeout(sandbox_id: str, timeout: int) -> None: ...
# Standard REST + JSON body, X-API-KEY authentication.

Implementation

Alternatives considered

Dependencies

Test Strategy

Acceptance criteria