Repository navigation
Boat box backend behind Computer, CF Containers fallback, human take control - #3
Conversation
…END) Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…b button + embedded desktop, agent computer use paused until hand back Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…ck, then continue Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
Original prompt from Raunak
|
…ion state on tmpfs Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…k test checks it Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…ter the hand back Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…ith sudo for apt; tsx devDependency; leaktest CI names a missing BOAT_API_KEY Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
… and fake vault Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…h it Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…al BW_* keys Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…starts Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
… bw works outside the browser server Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…ned when stdin is a socket Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…commands over 100 s (524) Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…ble), so Chrome's HTTP cache can't hold it Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…overable) and send the challenge as no-store, like a real RP, so Chrome doesn't cache the credential id Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
…anary (Boat keeps copies of the canary file) Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
Co-Authored-By: Raunak Chowdhuri <raunak@reducto.ai>
raunakdoesdev
left a comment
There was a problem hiding this comment.
Gates: red-team PASS, origin-check test, CI leaktest green, real Google passkey + Vercel SAML/Duo e2e PASS on staging. Raunak approved deploy.
Summary
Adds Boat (boat.dev) as a box backend behind the existing
ComputerDO.BOX_BACKENDselects it:cfin prod config,boatin staging. Callers and theBoxservice do not change. CF Containers stays as an automatic fallback.Boat path (
src/core/boat.ts,src/core/box.ts)#boot()resumes the stored sandbox id, or else creates the sandbox fromBOAT_TEMPLATE.{ noEnv: true, monitoring: false, failFast: true }with the default size. Boat therefore keeps no command history or output, and the VM gets no account credentials.boatdon port 8912, exposed withhost --private. Stdin and per-call env (secrets) go in the HTTPS request body, never in Boat exec args._tokenonce and answers with a 302 and a cookie.call()caches that cookie per daemon URL and retries once with a fresh cookie on 401/403/3xx.agent-N) are Boat forks ofmain. A fork is deleted aftermerge.main: same disk, same Chrome profile, same desktop on:0.boatDownfor 10 minutes and runs on CF. On Boat there is no setup.sh replay, because the disk persists.Secrets on Boat
vault run's child env, and in Bitwarden data on tmpfs (/dev/shm/raubot-bw).set([])after the run, and the decrypted item cache is dropped (vault.forget()).SessionsandSession Storagelive on tmpfs (RAUBOT_VOLATILE), because Chrome's tab-restore file kept typed form values.HISTFILE=/dev/null./swapfileis removed in the template. Boat recreates it on resume, so#boatUp()also runsswapoff -a && rm -f /swapfileafter every boot and resume.prestop()quits the browser server so cookies get flushed, kills Chrome, and clears tmpfs and/scratch. WithBOAT_WIPE_BROWSER_ON_STOP=1(default off) it also deletes the profile. Logged-in cookies and localStorage persisting is the accepted risk.Leak test (
npm run boat:leaktest,.github/workflows/boat-leaktest.yml)bwserving random values) and a WebAuthn passkey login (random P-256 key and credential ID) against a local site.grep -r /(detached), then a raw scan of/dev/vda1(test/rawscan.py; offsets are mapped to files withdebugfs).Needles cover each value as raw text, base64, base64url and hex. For passkeys they also cover the PKCS#8 DER, the PEM line, the private scalar and the credential ID bytes. A canary file is the control. Any match fails the test, and the sandbox is deleted in
finally.Take control
GET /takeover/(main|agent-N): behind Access, same-origin only. Each request mints a new desktop URL and addsoverlay=0; nopublicAccess. It answers with a302,no-store,no-referrer. The URL is never logged or stored.Computer.free()returns"free" | "released" | "held").Boat.#call()instead of falling back to CF.Vault origin check (
browser/origin.mjs,browser/server.mjs)vault.fill(locator, ref)andvault.type(ref)now refuse unless every URL they would put the value into has the same eTLD+1 (tldts.getDomain) as one of the item's saved URIs. The check runs before the value is read from the vault.Regression test:
browser/origin.test.mjs. Red-team kit:box/boat/redteam/(trap site, fakebw), scannerbox/boat/scan.mjs.Deploy / rollback runbook
Deploy (prod stays on CF until you flip it):
boat-base, push to Artifactsraubotmain,wrangler deploy. Prod config hasBOX_BACKEND: "cf", so behaviour is unchanged.wrangler secret put BOAT_API_KEY(prod).npm run boat:template-> setBOAT_TEMPLATEto the printed name (staging usesraubot-box-b63e44d1a1; theboatd15 s keepalive is newer than that template, so rebuild it).BOX_BACKEND: "boat"andBOAT_TEMPLATEin the prod vars and deploy again.GET /boxshowsbackend: "boat"; a bash call works;/takeover/mainopens the desktop.Migrating existing boxes: nothing to run by hand. On the first call after the flip,
mainhas no Boat sandbox, so it is created from the template,/workspaceand the raubot repo are cloned from Artifacts, andsetup.shis replayed once (withsudofor apt, since the Boat user is not root). After that the Boat disk persists, sosetup.shis not replayed again. Anything installed on CF but not insetup.shor/workspaceis lost, same as a CF restore today.Running subagents: a subagent box that already runs on CF stays on CF until it stops. New subagent boxes are Boat forks of
main, so they getmain's disk (including whatsetup.shinstalled) and need nothing reinstalled. A subagent that was mid-task on CF and boots again on Boat starts from a fork ofmain, so it must reinstall anything it installed itself outsidesetup.sh; its/workspacebranchagent-Nis restored from Artifacts.CF fallback (automatic): if Boat fails before a command starts (API error, 402/401, daemon not healthy in 60 s), the box sets
boatDownfor 10 min and runs that boot on CF (setup.shreplay as before). It goes back to Boat on the first boot after the CF container stops andboatDownhas passed. Boat 429s are retried, not failed over.Rollback: set
BOX_BACKEND: "cf"and deploy (or roll back to the previous Worker version). Boxes boot on CF and replaysetup.sh;/workspaceis in Artifacts, so no data is lost. Boat sandboxes are left stopped (stop = free); delete them later withDELETE /sandboxes/{id}+X-Ascii-Confirm-Delete: <id>.Real passkey e2e (raubot runs it, creds injected at use time)
Staging: https://raubot-staging.reducto.ai (Boat). Ask the staging agent, with
BW_CLIENTID/BW_CLIENTSECRET/BW_PASSWORDgiven only as per-call secrets:POST /box(stop), then repeat steps 1-2 (session should still be logged in).BW_*secrets:cd /workspace/raubot && node box/boat/scan.mjs; echo exit $?. Pass ="pass": true(0 secret files, 0 raw-disk secrets, canary found). Then stop the box and run it once more after resume.Results (real Boat VMs / staging)
raubot-box-b63e44d1a1--wipegrep -r /after resume/swapfile(debugfs icheck/ncheck). Pass with swap off (leak10, leak11, and leak12 on HEAD19fbed5): 0 secret matches, canary found. leak12: create 0.2 s, stop 20.7 s, resume 4.0 s, resume → daemon 4.5 s, snapshot 129 MB / 13,066 files, raw scan 74.9 GB in 18.5 min/swapfileon resume (leak12 saw a new 1 MB one). It is now turned off on every boot/resume, and leak12 fails if swap is still on. Staging main VM: no swap, no/swapfile429 rate_limited(12 starts/min) and ran on the CF fallback. All 12 finished and merged in 79.8 s; forks deleted within ~60 s. 429s are now retriedBOAT_API_KEYon current build401from Boat, ran on CF (BACKEND=cf), whole chat turn 35 s. Key restored afterwardsboatDown,backend: "cf", bash call 6.4 scodemode(tools.bash,tools.agent,tools.crons,tools.jobs)* * * * *cron onappchannel ran twice on schedule on Boat (BACKEND=boat,CRON_OK), then removed. On theimessagechannel the runs fail withsend failedbecause staging has noSPECTRUM_PROJECT_ID/SPECTRUM_PROJECT_SECRETsecrets (same on CF)302,no-store,no-referrer,overlay=0agent-N(computer use) opens the shared main VM desktopheld:falseafterresearch/injection-redteam.md: 4 agent runs (password, TOTP, passkey, "authorized") + 2 passkey reruns + a direct gate test. No canary on attacker pages or in requests; final file + journal + browser log + raw-disk (74.9 GB) scan: 0 matches, canary control foundnpx tsc -p .,npm test,vite build webStaging deploys need the global API key;
CLOUDFLARE_API_TOKENfails with "Container image preparation is not enabled for this account".Link to Devin session: https://app.devin.ai/sessions/2eb03b16c1bc48d7be38fc7a7d1cb712
Open in Devin Desktop: https://app.devin.ai/desktop/session/2eb03b16c1bc48d7be38fc7a7d1cb712?variant=devin
Requested by: @raunakdoesdev