Run sandbox command
sandbox_execRun shell commands as root inside an existing sandbox after user approval. Use ephemeral sandboxes because cancellation, timeout, or request failure deletes the sandbox and its files.
Instructions
Run a shell command inside an existing sandbox, as root. Requires the user's approval. Cancellation, timeout, or a failed command request destroys the whole sandbox and all its files to stop remote code. A nonzero command exit code preserves it. Use an ephemeral sandbox created for this task. Output is capped at 64 KiB per stream; do not blindly retry a failed command.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sandboxId": "<sandboxId>",
"command": "<command>",
"confirm": "<confirm>"
},
"name": "sandbox_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | /workspace | |
| envs | No | Environment variables for this command only | |
| command | Yes | ||
| confirm | Yes | User approved the command and loss of sandbox files if cancellation, timeout, or request failure requires cleanup | |
| sandboxId | Yes | Exact sandbox ID from sandbox_create or sandbox_list | |
| timeoutMs | No |