Exec Tool
The exec_in_sandbox tool runs a shell command inside a running sandbox
and returns stdout, stderr, and the exit code in a single response.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
sandbox_id | string | required | Target sandbox ID (from list_sandboxes) |
command | array of strings | required | Command and arguments (e.g., ["ls", "-la"]) |
timeout_seconds | number | 30 | Max execution time in seconds (max: 300) |
max_output_bytes | number | 65536 | Output byte ceiling per stream |
Output Format
{
"exit_code": 0,
"stdout": "...",
"stderr": "..."
}
When output is truncated, truncation metadata is attached to the tool result (not as a field in the JSON body).
Output Byte Ceilings
Stdout and stderr are each truncated independently when they exceed the
byte ceiling. The ceiling is set by the max_output_bytes parameter
(default: 64 KB). When truncation occurs, a truncation metadata object
is included in the result with combined byte counts across both streams.