runtime_sandboxes_exec
Run a shell command (bash -c) or an argv in a sandbox and get exitCode, stdout and stderr. Output over 16,000 characters in all keeps each stream's first line and its end, with outputCut and a note on reading the rest from a file. Waits for a sandbox that is still starting. A timeout returns timedOut: true with the output so far. background: true returns a processId at once, for servers, watchers and interactive programs; runtime_sandboxes_process reads and controls it. Runs as the sandbox user with passwordless sudo, HOME=/workspace. env sets environment variables and keeps their values out of the command line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| cwd | No | Working directory. Default /workspace. | |
| env | No | Environment for this command, merged over the sandbox's. Put secrets here, never in the command line: env is never echoed back. | |
| argv | No | Or the program and its arguments, run without a shell. | |
| stdin | No | Text given to the command's standard input, which is then closed. | |
| command | No | A shell command, run as `bash -c "<command>"` (pipes, &&, redirection and globs work), or a list of the program and its arguments, run without a shell. | |
| timeoutMs | No | Default 60000. Up to 24 h. | |
| background | No | Start it and return at once with a processId. | |
| stdinBase64 | No | Bytes for standard input, base64. | |
| idempotencyKey | No | Optional: left out, one is made and returned as idempotencyKey. Send it back only to retry this exact call after a temporary error. |