Repository navigation
docs: add boxd sandbox guide - #1277
Conversation
Add boxd to the cloud sandbox guides, overview, and sidebar. Cover passing resolved values through the machine spec and running a broker machine over its HTTPS domain, with agent machines pinned to the broker by boxd's egress allowlist.
There was a problem hiding this comment.
Caution
The recipe can expose inherited credentials to agents, and host-bound secrets can bypass its broker-only network policy. These security preconditions need to be documented before merging.
Reviewed changes: Reviewed the boxd sandbox guide and its navigation entries, including executable examples and provider security contracts.
- Environment handoff: Adds resolved-value and filtered blob examples using machine specs.
- Credential broker: Documents isolated broker/agent provisioning, authenticated tunneling, egress restrictions, lifecycle management, and host-bound secrets.
- Navigation: Adds the guide to the sandboxes overview and sidebar.
Website build and all 20 internal links/anchors passed; live cloud examples were not rerun.
gpt-6.1-sol | 𝕏
Isolated boxd machines still get the org's env vars and secrets whose scope covers them in exec and SSH sessions, and the hosts of a host-bound secret are admitted on top of the egress allowlist. Say so in the trust model, and qualify the broker-only claims.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the security guidance added since the previous review, verified the provider contracts, and resolved both addressed threads. The website build and new internal anchor passed.
- Documented environment inheritance: Explained that isolated agents still receive scoped values and must have no inherited sensitive credentials.
- Excluded host-bound secrets on agents: Explained their allowlist bypass and qualified broker-only confinement claims.
gpt-6.1-sol | 𝕏
|
thanks so much! |

Summary
I work on boxd. boxd runs full Linux microVMs (KVM) with a persistent disk that start in about a second, and can be hibernated, snapshotted and forked. This adds a boxd guide to the cloud sandbox recipes, next to Boat, E2B, Fly.io and Modal, and lists it in the sandboxes overview and the sidebar. Docs only, no code changes.
The guide follows the Boat guide's shape:
env(plus the__VARLOCK_ENVblob variant from the E2B/Modal guides).varlock proxy start --expose, its HTTPS domain carries the tunnel, and agent machines runvarlock proxy run --url. The agent's egress allowlist is then pinned to the broker host, which boxd enforces outside the VM.How it maps onto the sandbox recipe
boxd.machines.create({ spec: Machine.spec().isolated().env({...}), deleteAfter })boxd.machines.exec(id, { command })boxd.machines.fs.write(id, path, contents)proxies.setPort(id, 8080)boxd.machines.setEgressAllow(agentId, [brokerHost])deleteAfter(seconds)boxd.machines.delete(id)Where boxd does not map cleanly
Machine.spec().env(...). The values are kept in the machine's spec and can be read back through the API by whoever can read the machine; the guide says so.proxy run --urlfails with "tunnel handshake failed". The guide callssetBotProtection(brokerId, 'off'); the data-plane token is what gates the tunnel.boxdCLI acting as the owner, so an agent could exec into the broker and read its env. The guide usesisolated()for both machines and explains why.Machine.spec().from(snapshot(...)).egress(brokerHost)) for an allowlist from the first command.setsid nohup ... &inside a normalexec.execand SSH sessions, isolated or not, and the spec'senvonly adds to them. The guide says to create agents where no such value holds anything an agent should not have, and to keep credentials asunattachedsecrets.Test plan
Points 6 and 7 came from the automated review and are now in the guide's trust model section (the website builds with them). Checked again on 2026-11-08, with the branch still on the current
main(79fafc7): varlock 1.24.0 and@boxd-sh/sdk0.3.0 are still the latest releases, and the broker example, run as written on Bun, printedPlaceholder receivedin 6 s and deleted both machines.The first full pass:
Everything below ran against real boxd (region fra) with varlock 1.24.0 (standalone binary in the machines, npm package in the orchestrator) and
@boxd-sh/sdk0.3.0, on Bun 1.4 and Node 24. For the live runs I extracted the code blocks from the.mdxand changed only two things: a machinenameand an extra label, so our test machines are easy to find and clean up.Placeholder receivedand deletes both machines. 3 runs (Bun, Bun, Node), all pass, about 6 s each.Machine command failed.varlock run(CLI) and a Node app withvarlock/auto-loadboth readAPI_KEYfrom__VARLOCK_ENVin an empty directory.boxdCLI; the agent's direct HTTPS to example.com fails within 66 ms ofsetEgressAllowand DNS for it is refused; placeholder delivered through the clamp; a curl request to an echo API through the broker gets the key injected (audit showsinjected=API_KEY) and the response the agent sees is scrubbed; Nodefetchgoes through the broker; a host without a rule is blocked by strict egress (blocked-egressin the audit); a wrong token is refused; after the broker is hibernated, the agent's nextproxy run --urlwakes it and works (265 ms).proxy run --urlfails with "tunnel handshake failed"; with it off it works.claude -p) in an agent machine pinned to the broker, withANTHROPIC_API_KEYheld only by the broker (@proxy(domain="api.anthropic.com")), answered correctly.BOXD_API_KEYthrowsSet BOXD_API_KEY and API_KEY; a bad key throwsAuthenticationError: API key not recognized.bunx turbo run build --filter=@varlock/websitebuilds (138 pages, the new page and overview card render, I checked a screenshot), all internal anchors on the page resolve,eslint .is clean, and the pre-push hooks (branch name, frozen lockfile,typecheck:all, bumpy) pass. No bump file, since only docs changed.All test machines were deleted after each run.
Links