Sandbox API

L4 product integration

How L4 apps consume Sandbox.Turing.Com via SandboxClient and gateway routes.

L4 product integration

L4 products are customers of the sandbox platform — not dependencies of it.

Dependency rule

  • L4 → SandboxClientSANDBOX_GATEWAY_URL
  • sandbox/ → import TerminalBench/ or other L4 trees ❌

Quick start

export SANDBOX_GATEWAY_URL=http://localhost:8780
export SANDBOX_API_KEY=dev-key
from sandbox_core.clients.sandbox_client import SandboxClient

client = SandboxClient.from_env()
job_id = await client.submit_execute_tasks(
    {"tasks": [...]},
    correlation_id="prism-trial-99",
)

Use a stable correlation_id per eval run so logs, harbor workers, and Langfuse share one key. Details: Observability.

Route by intent

IntentRoute
Harbor benchmarkPOST /sandbox/harbor/v2/jobs/execute-tasks
Sync datapointPOST /sandbox/harbor/v1/run/datapoint
Agent runPOST /sandbox/agent/v1/runs
Code executionPOST /sandbox/codeedit/v1/executions
CatalogGET /sandbox/v1/catalog

See Harbor datapoint and Code execution for request shapes.

Detaching legacy folders

Platform teams can remove legacy product directories without editing sandbox/ when:

./scripts/check-legacy-detachable.sh TerminalBench

Manifest: docs/sandbox/migration/legacy-product-roots.yaml in the monorepo.

Full playbook: internal doc docs/sandbox/migration/l4-integration.md.