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

ParameterTypeDefaultDescription
sandbox_idstringrequiredTarget sandbox ID (from list_sandboxes)
commandarray of stringsrequiredCommand and arguments (e.g., ["ls", "-la"])
timeout_secondsnumber30Max execution time in seconds (max: 300)
max_output_bytesnumber65536Output 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.