Skip to content

feat(standard): run each unit's agent in a Boat VM of its own - #150

Merged
aitianshi merged 9 commits into
mainfrom
research/boat-sandbox-fit
Nov 17, 2026
Merged

aitianshi merged 9 commits into
mainfrom
research/boat-sandbox-fit

Conversation

@aitianshi

@aitianshi aitianshi commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #149

What

Adds Boat as a third backend for runs of the standard. Each unit's agent or capability runs in a boat.dev VM of its own, started where the run runs (this machine or a Settings host) with the key saved here in Settings → Sandbox.

How a unit runs on Boat

  • The agent runs as an unprivileged user in the VM. iptables limits it to loopback, with DNS refused, and the unit's relay, beside the run, is reached through an ssh -R tunnel, so the VM never holds a model key.
  • The agent's environment, which holds the relay's word and any licence value, goes to the VM as a file only the agent's user reads, and its shell removes it. It is never on a command line, here or in the VM.
  • The agent's install, its definition and its runtimes go to the VM before the agent's time starts. Its home and workspace are sent as it starts, after its setup writes its config. Results come back with rsync --safe-links.
  • A check that executes the agent's code (score.runs_code: HumanEval, the workspace kit) runs it back where the run runs, in the throwaway check container, never as the user. Review asks for Docker there, and the run is refused without it.
  • The VM's auto-stop follows the unit's time limit. A free trial caps it at 2 hours, and the run says so once when a unit could outlast that; later units then ask for the 2 hours at once.
  • The VM is always deleted, whatever ends the unit. On a Stop, nothing is fetched back, and a Stop also ends the wait for a VM to come up. A delete Boat refuses is tried once more, then said and kept as delete_error in agent/boat.json.

Refusals and warnings

  • A runtime link that would send the user's home, keys, a tool's login folder (~/.config, ~/.local, ~/.docker, …) or Nullius's storage to a VM is refused.
  • A unit whose setup gives the agent MCP servers, or needs its own image, ends as not run, with the reason.
  • The run uses no more units at a time than the account can run VMs at once.
  • Before starting, the run says when the account can start fewer VMs this hour or today than it has units. A unit waits up to an hour for a free start, and a Stop ends the wait.

The key

  • The Boat key is withheld from every command Nullius runs, Harbor runs included. Only a standard run on Boat receives it, over stdin like the agent keys, on this machine or a host. A host is checked for ssh, ssh-keygen, rsync and tar among its prerequisites.

Interface

  • Settings → Sandbox adds the Boat key, edits it and removes it; Remove asks first.
  • Builder, Where step: Boat is offered on this machine and on hosts, with the VM sizes the account can start; the others are greyed out. A backend that cannot be used says so under its name, so the name stays whole.
  • Review: the Where line names the size, and Review refuses a size the account cannot start.
  • Logo: Boat's mark switches to its white version on a dark background.

Touches

backend · routes · templates and static · docs and site · the standard

  • app/nullius/standard/boat.py (new), run.py, recipe.py, job.py, cli.py, kits/agent-workspace-v1/standard.json (runs_code)
  • app/nullius/execution.py (the Boat key withheld, handed to a Boat run), prerequisites.py (a host's Boat programs)
  • app/web/execute.py, builder.py, settings.py
  • app/static/builder/, app/static/settings/sandbox.js, app/templates/settings/settings.html, app/static/style.css, app/static/brand/boat.svg and boat-dark.svg (Boat's own marks, copied unchanged)
  • app/tests/test_standard_boat.py, app/tests/test_execution.py, app/tests/test_prerequisites.py, app/ui_tests/test_settings_page.py, app/ui_tests/test_agents.py
  • docs/standard.md, docs/builder.md, docs/cli/run.md, docs/settings/sandbox.md; AGENTS.md (a Documentation convention: docs/ stays terse)

Before and after

Screenshots were taken locally, in light at 1280 px and dark at 390 px:

  • Settings → Sandbox: before, no Boat card. After, a Boat card with Add key, Edit, and Remove with its confirmation.
  • Builder, Where step: before, Local processes and Container. After, a Boat tile and a VM size row: Small and Default can be chosen, Large and XLarge read "Not on this account" on a trial.
  • Review: after, the Where line names the size ("small VMs"), and a size the account cannot start is refused: "Boat cannot start a large VM on this account: … Choose another size."

Verified

Tests, on 5cd922b (main) plus this branch:

  • Backend suite: every module passes, each run alone with a 5-minute limit (the parallel runner hangs on this machine); 2160 tests before the host change.
  • Route suite: 530 tests pass.
  • test_standard_boat.py: 36 tests with a stand-in VM. Besides the run itself they cover:
    • the firewall's rule order;
    • the environment sent on stdin, never on argv;
    • a Stop while a VM comes up;
    • refused runtime links, ~/.local and ~/.config included;
    • a delete Boat refuses;
    • the trial's TTL, remembered.
  • test_execution.py: only a standard run on Boat is handed the Boat key.

Real runs on a free-trial Boat account

  • HumanEval, 2 problems, model meta/muse-spark-1.3-contributor, --max-usd 0.10.
    • Before the review fixes, every agent scored 2/2:

      Agent VM and install Agent time
      opencode 55 s 10 to 12 s
      codex 76 to 80 s 13 to 17 s
      goose 37 to 55 s 17 to 21 s
      reference 6 to 9 s 11 to 17 s
    • After the fixes, and again after the rebase onto main: opencode scored 2/2 three times. In the two runs whose trials were read, each recorded check: container.

  • In one real VM, as the agent's user:
    • name lookup failed (dns=2);
    • the internet failed (internet=7);
    • loopback answered (loopback=0);
    • iptables -S OUTPUT listed the DNS rejects before the loopback accept.
  • No VM was left after any run (GET /sandboxes returned []). Model spend was about $0.02 in all.
  • The starts warning against the real account:
    • 20 units: "Boat can start 9 more VMs this hour on this account: the other units wait for the next hour"
    • 164 units: "… 105 of the 164 units will end without running"

Browser

  • Settings, the Where step and Review, in light at 1280 px and dark at 390 px: no page errors.
  • The Boat mark shows its white version in dark and the blue one in light.

Not verified

  • No real Boat run from a host: the key's hand-over to a host and the host's prerequisites are tested with a stand-in host.
  • No paid-plan account: Large and XLarge sizes, and auto-stops over 2 hours, are untested.
  • A delete Boat refuses was only seen with a stand-in; no real delete failed.

Risk

  • The local and container backends are untouched except for shared plumbing in run.py: the unit's VM context and the agent-time ordering.
  • The workspace kit's check now declares runs_code. That changes nothing on the local or container backends; it only makes a Boat run of the kit need Docker.
  • If Boat's API changes, Boat runs end with EnvironmentSetupError and the other backends are unaffected.
  • A VM that outlived a crash of this machine is stopped by Boat's own auto-stop.
  • Undo by reverting the commits; nothing is migrated.

@aitianshi aitianshi self-assigned this Nov 16, 2026
@github-actions

This comment has been minimized.

Adds the boat backend (app/nullius/standard/boat.py): one boat.dev VM per
unit, the agent as a user locked to the VM's loopback, its model calls
through a reverse tunnel to the unit's relay on this machine, the workspace
copied back without links that leave it, the VM deleted after. Concurrency
is capped to the VMs the account runs at once. The builder's Where step
offers Boat; Settings > Sandbox keeps its API key with Edit and Remove.
…ot start every unit

Send the install before the agent's time and the home and workspace as it
starts; follow the unit's time with the VM's auto-stop, within a trial's
2 hours; refuse links that would send this user's own files; delete a VM
whatever ends the unit, and skip the fetch on a Stop. Review refuses a size
the account cannot start, Remove asks first, the run says when the account
can start fewer VMs this hour or today than it has units, and the Boat mark
has its own version on a dark background.
- A Boat run whose check executes the agent's code checks it in the
  throwaway check container, and is refused without Docker; it ran as the
  user on this machine. The workspace kit's check declares runs_code.
- A unit whose setup gives the agent MCP servers is not run on Boat: they
  start from this machine's paths, which the VM does not have.
- The agent's user's firewall refuses DNS before it accepts loopback; the
  rules were inserted in an order that let DNS through.
- The agent's environment (the relay's word, a licence's value) goes to the
  VM as a file its user reads and removes, never on an ssh command line.
- A Stop ends the wait for a VM to come up, and the VM is deleted.
- Runtimes linked from ~/.local, ~/.cache, ~/.config and other tools'
  login folders are refused, with the Backend's own environment.
- The Boat key is withheld from every run's environment and handed over
  stdin only to a standard run on Boat.
- Once a trial's 2-hour cut is known, later units ask for it at once.
A delete is tried twice, and a VM already gone counts as deleted. One
Boat still refuses is said, with when it stops by itself, and kept as
delete_error in the unit's agent/boat.json; the end-of-run sweep says
each VM of the run it could not delete.
@aitianshi
aitianshi force-pushed the research/boat-sandbox-fit branch from f1368d9 to bf70b27 Compare November 17, 2026 15:39
@github-actions

This comment has been minimized.

The section's table was the mechanism, cell by cell. It now keeps the
guarantees, the requirements and the refusals; the builder, CLI and
Settings rows say only what Boat is and where it is set.
@github-actions

This comment has been minimized.

Why a backend cannot be used sat beside its name without wrapping, which
squeezed the name until it broke mid-word (Containe/r) once Boat made the
row three tiles. It now goes under the name; a row's tiles stay one height.
@github-actions

This comment has been minimized.

A run on a host starts its Boat VMs from there. The key stays in this
machine's store and reaches the run over stdin, as the agent keys do;
Review checks it here, and the host's ssh, ssh-keygen, rsync and tar
among its prerequisites. A Boat run whose check runs the agent's code
now asks Review for Docker where it runs.
@github-actions

This comment has been minimized.

The Boat section drops what is mechanism (how the key travels, what a
host is checked for) and keeps what a user decides on. AGENTS.md gains a
Documentation convention so later changes keep the same standard.
@github-actions

This comment has been minimized.

A run started by Nullius keeps only its provider's key and endpoint of
the environment its launcher gives it (run_env), which dropped the Boat
key handed over stdin. Here the run fell back to the key saved in
Settings; a host has none, so a run on Boat there was refused for want
of a key.
@github-actions

Copy link
Copy Markdown

🔴 PR judge · 5 of 8 yes · #150 ↔ #149

Merge risk 🔴 MAJOR the judge's reading of the diff; app/nullius/execution.py is in the path of every run
Priority 🔴 EXTREME the deepest path is app/nullius/execution.py
Question Verdict
Changes do what the issue asks · 11 of 11 criteria ✅ yes
Issue and pull request describe the same change ✅ yes
Description matches the diff, no more, no less ⚠️ partly
Diff stays in scope ✅ yes
Tests cover the change, or Verified says how ✅ yes
Docs follow the change ✅ yes
Risk named in the description ⚠️ partly
Before and after shown · 0 images · the diff touches what is visible ❌ no
Acceptance criteria, 11 of 11 met
# Criterion Verdict
1 nullius standard run ... --backend boat [--boat-size SIZE] runs each unit's agent or capability in its own Boat VM, a… ✅ met (cut)
2 The agent in the VM reaches only its relay; no model key is sent to the VM ✅ met (cut)
3 Every VM a run starts is deleted, on success, failure, timeout and Stop ✅ met (cut)
4 The VM's auto-stop follows the unit's time limit, within the 2 hours a free trial allows ✅ met (cut)
5 Time spent starting the VM and installing the agent is not counted as the agent's time ✅ met (cut)
6 Nothing under the user's own private folders (home, keys, Nullius config) is sent to a VM through a link ✅ met (cut)
7 Settings → Sandbox saves, edits and removes the Boat key; Remove asks first ✅ met (cut)
8 The builder's Where step offers Boat only on this machine, with the account's VM sizes; Review refuses a size the accou… ✅ met (cut)
9 A run says when the account can start fewer VMs this hour or today than the run has units ✅ met (cut)
10 Units that need a benchmark's MCP server or their own image end as not run on Boat, with the reason ✅ met (cut)
11 docs/standard.md, docs/builder.md and docs/cli/run.md describe the backend ✅ met (cut)
Checks the script runs itself, 4 of 4 pass
No machine attribution trailer in the commits or the description ✓
New code under app/, docs/, .github/ or .claude/ ✓
No Flask import under the backend package ✓
No key-shaped string in the diff ✓

some of the diff was cut before the judge read it

@aitianshi
aitianshi merged commit 2815e65 into main Nov 17, 2026
2 checks passed
@aitianshi
aitianshi deleted the research/boat-sandbox-fit branch November 17, 2026 16:10
aitianshi added a commit that referenced this pull request Nov 17, 2026
… work on a unit and cap its model calls (#191)

Closes #190

## What

A standard run can now force its limits, and the agent's time limit
covers its whole work on a unit.

- **Time limits by phase.** `run --timeout PHASE=SECONDS` forces the
limit of a phase: `setup`, `image`, `agent`, `verify` or `score`. Empty
keeps the default, which comes from the task, then the benchmark, then
Nullius. `config.json` records what was forced under
`standard.timeouts`.
- **One agent limit per unit.** The agent's limit is one deadline for
its whole work on a unit: every turn of a conversation, and the
simulated user's time between them. Before, it applied to each reply. A
capability keeps one limit per add and per recall, because a memory adds
a unit's sessions one by one. τ³-bench's `limits.turn_seconds` goes from
600 s a reply to 7200 s a conversation.
- **Turns.** `run --max-turns N` sets the turns of a conversation. The
builder offers it only on a benchmark that holds conversations.
- **A cap on model calls.** `run --max-calls N` caps the model calls an
agent makes on a unit. The relay counts each answered call on the
agent's route; rate-limited and failed calls are not counted, and
neither are the judge's or the simulator's. Past the cap the relay
refuses the call with a 402, and the unit ends as `UnitCallCapError`, an
agent error that is not scored. It is for agents only: a capability's
route also carries the benchmark's reader, so a capability run refuses
it.
- **A benchmark's own bounds.** They are now options marked `limit`.
τ³-bench gets Steps per conversation (`--max-steps`, from 1 up to its
default of 200) and Tool errors per conversation (`--max-errors`).
OSWorld gets Steps per task (each agent script's `--max_steps`); left
empty it uses the chosen agent's own value, declared with the new `by`
key.
- **Builder, Limits step.** It shows Scope, then Time limits in minutes,
then a section named after the benchmark when it has bounds of its own.
An empty field shows the value the run uses: in the text colour when the
benchmark or the agent declares it, grey when it is Nullius's default
(priority: Nullius < agent < benchmark). Nothing is typed into a field
for the user.

## Touches

- `app/nullius/standard/`: `run.py`, `relay.py`, `container.py`,
`job.py`, `cli.py`, `recipe.py`, `definitions.py`
- `app/nullius/runs/classify.py`: `UnitCallCapError` is an agent error
- Catalogue: τ³-bench and OSWorld's `standard.json`, their drivers and
`upstream-settings.json`
- `app/static/builder/`: the Limits step
- Docs: `docs/cli/run.md`, `docs/standard.md`, `docs/builder.md`, the
field guide and the generated supported-benchmark pages

## Before and after

The Limits step for τ³-bench, before and after:

| Before | After |
| --- | --- |
| <img width="440" alt="Limits step on main: Scope only, with tasks,
concurrency, attempts and two spending caps"
src="https://github.com/user-attachments/assets/80b468a4-326f-4057-a4b2-5551ea93e642"
/> | <img width="440" alt="Limits step on this branch: Scope with turns
and model calls, Time limits in minutes, then a tau3-bench section with
steps and tool errors"
src="https://github.com/user-attachments/assets/6278494c-6c9f-456f-b739-9578494315ee"
/> |

## Verified

- Backend suite: 2175 tests OK. Route suite: 531 tests OK (after merging
`main`, with #124's serving providers and #150's Boat VMs).
- New tests:
- A whole conversation that ends past the agent limit, though no single
turn does.
  - Four one-call turns cut on the fourth call by `max_calls=3`.
  - The relay counts only answered calls on the agent's route.
- A slow capability whose three adds each fit a 1 s limit while their
total does not.
  - A capability run refuses `--max-calls`.
- Recipe validation of the limits, including a value that rounds to 0 s.
  - τ³-bench steps above 200 are refused.
- OSWorld's `--max_steps` is replaced, or added when the agent's command
doesn't set it.
- Against the installed τ³-bench upstream: the driver uses 200 steps and
10 errors by default, and 7 and 3 when the run sets them.
- Checked in the browser, light and dark, for τ³-bench and OSWorld.

## Risk

- **Agent timeouts on conversation benchmarks.** A conversation that
used to fit 600 s per reply now has a single limit for the whole
conversation, 7200 s on τ³-bench. A very long conversation can now time
out where it didn't before. Undo by forcing a larger `--timeout
agent=SECONDS`, or by reverting `limits.turn_seconds`.
- **Comparability.** A run whose limits differ from the defaults is not
yet marked as not comparable with the leaderboard.
- **Overlap.** #174 (the agent's setup timed apart from its run) and
#133 (a benchmark's own limits) change the same parts of `run.py` and
the catalogue, so expect merge conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standard: run each unit's agent in a Boat VM of its own

1 participant