Sandbox API

Core concepts

Jobs, scoring, tenancy, substrates (pods and VMs), and correlation ids.

Six ideas cover almost everything you will meet. The ones that catch people out are scoring vs status and which agent you may use.

Synchronous vs asynchronous

SynchronousAsynchronous
ExamplePOST /sandbox/harbor/v2/run/datapointPOST /sandbox/harbor/v2/jobs/execute-tasks
Returns200 with the complete result202 with a job_id
Good forShort runsAnything real — long tasks, many agents, cancellation

Both put work on the same queue. Sync is not a way around a busy queue. On timeout you get 504, the run keeps going, and the job id is in the headers — poll it; do not resubmit.

A job and its lifecycle

StatusMeaning
queuedAccepted, waiting for capacity
runningA worker is executing it
succeededFinished with at least one real result
failedNothing usable, or the platform gave up
cancelledYou asked it to stop

Prefer SSE …/events for live updates; resume with Last-Event-ID.

status is not a verdict

FieldAnswers
statusDid orchestration finish?
outcome.valid_for_scoringShould you believe the numbers?

Gate scoring on outcome.valid_for_scoring. Agent runs expose completion instead — they are ungraded. Details: Run a benchmark.

Agents are catalog ids

You do not invent agent names. Pass an id from GET /sandbox/v1/catalog?kind=agent. Agent runs reject anything else with 400.

Common idRole
opencodeRecommended default coding agent
claude-code, codex, gemini-cli, …Other coding CLIs
terminus-2Harbor reference agent with reasoning effort
oracleTask validator — needs solution/solve.sh

Full list and examples: Supported agents.

Substrates: pods, VMs, external

Isolation is not “always a container”:

SubstrateWhen
PodHarbor/Agent trials, CodeEdit, default long-lived, Linux desktop
VMWindows desktop (ec2-vm)
External MacmacOS desktop (aws-ec2-mac provider)

The catalog profile driver_hint selects the substrate. Callers use the same Sandboxes API. See Architecture.

Artifacts

List then download — not returned inline.

CallGives you
GET …/jobs/{job_id}/artifactsInventory
GET …/jobs/{job_id}/artifacts/archiveTime-limited archive URL

Artifacts expire. Download what you need to keep.

Tenancy: tenant and project

Every request resolves to tenant:project for billing, quota, and isolation. Jobs are visible only to the same tenancy — otherwise 404 (same as missing).

Authentication.

Correlation id

Send x-correlation-id once per logical run. It appears in logs, traces, and Langfuse. Observability.