X-Sandbox-Token header. See Tokens to learn how to mint one.
The data plane is available whenever the sandbox is running, even if the control
plane is temporarily unavailable. Capability tokens carry all the information the
gateway needs to verify the request without phoning home.
POST /commands
Runs a command inside the sandbox and blocks until the command exits or the timeout elapses. Output is captured and returned in a single JSON document. If the output exceeds the capture limit, thetruncated flag is set to true.
Use this endpoint for short, discrete commands. For commands with unbounded output, interactive sessions, or PTY requirements, use POST /processes and the streaming API instead.
string
required
The program to run. Use an absolute path or a name resolvable on
$PATH inside
the sandbox.string[]
Arguments passed to the command. Up to 256 entries.
string
Working directory for the command. Omit to use the default user’s home
directory.
object
Additional environment variables set for this command only. Keys and values
are strings. These are merged with the process environment; they do not
replace it.
string
Bytes written to the command’s stdin before it is closed. Use this for
commands that read from stdin without being interactive.
integer
Kill the command if it has not exited after this many seconds. Omit to use
the agent’s default timeout.
200 OK
The command ran. Check exit_code to determine success or failure.
integer
required
The command’s exit code. Zero means success. A negative value means the
command was killed by a signal.
string
required
Standard output captured from the command.
string
required
Standard error captured from the command.
boolean
True when the output exceeded the agent’s capture limit. The captured portion
is still returned. If you need the full output, use the streaming API instead.
400 malformed request · 401 unauthenticated or expired token · 408 timeout elapsed (command was killed) · 429 per-sandbox concurrent-connection cap reached
POST /processes
Starts a supervised background process and returns as soon as it has been spawned. The process continues running after your HTTP request completes. Attach to its WebSocket stream for live output, stdin, signals, and PTY resize events.string
required
The program to run.
string[]
Arguments passed to the command. Up to 256 entries.
string
Working directory. Omit to use the default user’s home directory.
object
Environment variables set for this process only.
object
Allocate a pseudo-terminal for this process. Required for interactive
programs such as shells, editors, and TUI applications.
201 Created
integer
required
The process ID inside the sandbox. Use this to stream output, read logs,
and send signals.
string
required
The command as started.
string
required
ISO 8601 timestamp when the process was spawned.
boolean
required
True if the process is still running at the time of this response.
boolean
required
True if a pseudo-terminal was allocated.
400 malformed request · 401 unauthenticated · 429 concurrent-connection cap reached
GET /processes
Lists the processes the agent supervises inside the sandbox. This includes running processes and recently exited ones that the agent has not yet reaped.200 OK
Process[]
required
Array of process objects. Each has the same fields as the
POST /processes
response: pid, command, started_at, running, pty, exit_code
(when exited), and exited_at (when exited).401 unauthenticated
GET /processes/
Gets the current state of a single supervised process.integer
required
The process ID as returned by
POST /processes.200 OK
integer
required
Process ID.
string
required
The command that was started.
string
required
ISO 8601 start timestamp.
boolean
required
True if the process is still running.
boolean
required
True if a PTY was allocated.
integer
Exit code, present when the process has exited. Negative values indicate the
process was killed by a signal.
string
ISO 8601 timestamp when the process exited.
401 unauthenticated · 404 process not found
DELETE /processes/
Sends a Unix signal to a supervised process. The default isSIGTERM. Use SIGKILL when the process does not respond to SIGTERM.
integer
required
The process ID.
string
The signal to deliver. One of
SIGTERM (default), SIGKILL, SIGINT, or
SIGHUP.204 No Content
Error codes: 401 unauthenticated · 404 process not found
GET /processes//logs
Reads buffered output that the agent has retained for this process. The agent keeps a ring buffer of recent output; use theafter parameter to read new chunks since your last call. For live output, use the WebSocket stream instead.
integer
required
The process ID.
integer
Return output chunks with a sequence number greater than this value. Default
0 to read from the beginning of the retained buffer.200 OK
object[]
required
Log chunks in sequence order.
integer
required
The next sequence number. Pass as
after on the next call.boolean
required
True if the process is still running at the time of this response.
integer
Exit code, present when
running is false.integer
The lowest sequence number currently retained. If this is greater than your
last
after value, some output has been evicted from the ring buffer.401 unauthenticated · 404 process not found