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

CLI / cloud / sandbox / grade

kosa8 cloud sandbox grade

Grade a sandbox in a sealed fork: hidden files, no network, a reward

Usage#

kosa8 cloud sandbox grade ID [--file LOCAL:/PATH ...] -- COMMAND [ARG...]

Forks one copy of the solved sandbox, takes its network away, writes the --file files there (hidden tests the solver never sees), runs the command and reads the reward, then deletes the copy (--keep keeps it an hour).

The reward is the last line of stdout that is a JSON object with a number "reward" (and optional "metrics"), e.g. {"reward": 0.75}; without one, exit 0 is 1.0 and any other exit 0.0. The failure class says why it did not pass: ok, exit_nonzero, timeout, infra, quota or client. An infra failure has no reward: mask it and retry rather than scoring it 0.

--run records the graded rollout on that RL run (kosa8 cloud rl runs get RUN).

Options#

FlagTypeWhat it doesDefault
-e, --envstringArrayset a variable for the command, NAME=value or NAME for this shell's value (repeatable)[]
--env-filestringArrayread NAME=value lines from this file (- for stdin; repeatable)[]
-f, --filestringArraywrite this local file into the grader at an absolute path, LOCAL:/PATH (repeatable, 8 MiB in all)[]
--groupstringwith --run: the rollout's group (e.g. the prompt's id)—
--indexintwith --run: the rollout's index in its group0
--keepboolkeep the grader copy (an hour) to look into it—
--outputboolprint the command's stdout and stderr (their last 64 KiB) too—
--runstringrecord the graded rollout on this RL run (run_…)—
--stepintwith --run: the training step of this rollout0
--timeoutdurationstop the command after this long, 1s to 90s (default: the API's)0s

Example#

  kosa8 cloud sandbox grade sbx_abc --file tests/test_hidden.py:/grader/test_hidden.py -- pytest -q /grader/test_hidden.py
  kosa8 cloud sandbox grade sbx_abc --run run_8f2k --step 12 --file grade.py:/grader/grade.py -- python3 /grader/grade.py
  kosa8 cloud sandbox grade sbx_abc --json -- ./score.sh | jq .reward

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 · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA