kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

CLI / cloud / sandbox / exec

kosa8 cloud sandbox exec

Run a command in a cloud sandbox, or start one in the background

Usage#

kosa8 cloud sandbox exec ID -- COMMAND [ARG...]

Runs the command to completion, printing what it writes as it runs, and exits with the command's exit code. A sleeping sandbox wakes for it. Output streams, so a command is not cut off at the 90 s a buffered API exec is held to (on a host that cannot stream, it is: use --background for longer ones there). --json prints {exit, stdout, stderr} once it ends.

--background (-d) starts it and returns at once with its ID (bg_…); it keeps running after this call, its output going to a file in the sandbox. Check on it, or wait for it, with kosa8 cloud sandbox exec-status.

--timeout stops the command in the sandbox when it runs that long (exit 124), the way to bound a test run or build you do not trust to finish.

-e NAME=value sets a variable for this command; -e NAME takes NAME's value from this shell and --env-file reads KEY=value lines, so secrets stay off argv.

Options#

FlagTypeWhat it doesDefault
-d, --backgroundboolstart it and return at once with its ID (bg_…)—
-e, --envstringArrayset an environment variable, NAME=value, or NAME for this shell's value (repeatable)[]
--env-filestringArrayread NAME=value lines from this file (- for stdin; repeatable)[]
--imagestringimage to run the command in (default: the template's own)—
--timeoutdurationstop the command after this long (exit 124); unset, wait up to an hour1h0m0s

Example#

  kosa8 cloud sandbox exec sbx_abc -- python3 -c 'print(1+1)'
  kosa8 cloud sandbox exec sbx_abc -e DEBUG=1 -e GITHUB_TOKEN -- ./run.sh
  kosa8 cloud sandbox exec -d sbx_abc -- python3 -m http.server 3000
  kosa8 cloud sandbox exec-status sbx_abc bg_0123456789abcdef --wait

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA