Repository navigation
docs: add sandbox agents guide and startup time tips - #32280
Conversation
Rewrite the sandboxing agents guide around kernel, network, and secrets isolation, with fast startup as a bonus. Add registry templates, sandbox coverage by access method, sandbox profiles as immutable parameters, example network rules, scoped agent and AI Gateway tokens, and just-in-time credentials. Add pre-warmed Kubernetes nodes, baked images, prebuild claim tips, and presets per configuration to the speed-up templates guide. Mark Agent Firewall as being phased out.
Sysbox maps container root to an unprivileged host user, but system calls still reach the node's kernel, so it isn't kernel isolation. Sandbox runtimes boot in milliseconds, but a Coder workspace also waits for the workspace build, so point to the fast startup section instead of claiming sandboxes start in seconds.
nickvigilante
left a comment
There was a problem hiding this comment.
Approved with changes. Thanks for writing this up! My feedback is a mixture of my comments and Coder Agents's comments. Coder Agents notes:
Main issues before merge:
- The AI Gateway token example fails for prebuilds, which the page recommends for every profile. Inline suggestions add the
is_prebuildguard that Plain Sandbox already uses. - The EKS scale-down example also terminates nodes that run prebuilt workspaces, since prebuilds don't auto-stop.
- The process logging note describes the wrong mechanism. The suggested wording asks readers to test with their runtime instead.
- Learn more still points to Agent Firewall in several places, even though the PR removes it as a network method.
The rest are wording nits and companion edits for the sandbox-agents.md rename (docs/manifest.json and the link in speed-up-templates.md).
daveahr2172
left a comment
There was a problem hiding this comment.
Nice page. Some possible feedback below, none of it blocking. Take what's useful.
What works well: the fixed security settings with presets, the warning that NetworkPolicy needs a CNI that enforces it, being upfront about the gaps that host-name filtering leaves, and the note that credentials end up in Terraform state.
Inline comments cover:
- AWS Nitro Sandboxes as a kernel isolation option
- A lifetime and revocation for the AI Gateway token example
- Agent Firewall marked as phased out but still recommended
- A cloud egress firewall layer
- Per-workspace scope for Pod Identity
- Caveats for the start-up tips
- Process logging and Nitro
On CI: the three failing checks (check-docs, engine, doc-check) look like setup problems, not content problems. They show a blocked reviewdog/action-setup action, a missing GitHub App client-id secret, and an expired Coder session.
Generated with Coder Agents, on behalf of @daveahr2172.
Rename the guide to sandbox-agents.md, add Nitro Sandboxes, cloud firewall, and Pod Identity guidance, guard the AI Gateway token example against prebuilds, and expand node pre-warming and rollout wait notes.
Adds a "Sandbox agents" guide under Extending templates, and adds startup time tips from the Improving Coder Workspace Startup Times livestream to the speed-up templates guide.
Sandbox agents (
docs/templates/extending-templates/sandbox-agents.md) is organized around three traits: kernel, network, and secrets isolation, plus fast startup. Each trait has a short methods table with tradeoffs, plus examples and references.isolated-sandboxRuntimeClass in EKS Auto Mode).api_key_scope = "no_user_data", a scoped AI Gateway token (skipped for prebuilds, optionallifetime), per-workspace EKS Pod Identity, and just-in-time credentials from Vault.Speed up templates (
docs/workspaces/speed-up-templates.md) gets new sections for pre-warming Kubernetes nodes (with GKE, EKS, and AKS alternatives), building tools into the image, prebuilt workspaces (including one preset for each configuration), and skipping the Kubernetes rollout wait (with coder-logstream-kube to surface Pods that can't start). It links the fast-workspaces-lab repo for the sample base image, node schedule, and prebuild templates.Agent Firewall gets a notice on its index page and in the glossary that it is being phased out, pointing to the sandbox guide. The sandbox guide doesn't mention Agent Firewall.
Two diagrams in the speed-up templates guide come from the talk's slide deck, cropped to the diagram.
Notes for reviewers:
user:read_personal) isn't tied to a workspace, so with several organizations, AI Gateway uses the user's effective group for budgets. The page doesn't mention this.Decisions and checks
wait_for_rolloutand coder-logstream-kube cover the startup and error cases.mutable = falseis enforced on later builds (coderd/dynamicparameters/resolver.go).preset_id(coderd/database/queries/prebuilds.sql,coderd/workspaces.go).no_user_datablocks the Git SSH key and external auth (coderd/gitsshkey_test.go,coderd/externalauth_test.go).coderd/apikey.go), and the default token lifetime is 7 days (codersdk/deployment.go).CODER_SESSION_TOKENin a workspace; registry modules such ascoder-logindo.make lint/emdash,make lint/docs-html,make lint/docs-manifest, markdownlint, markdown-table-formatter, Vale (0 errors), and the pre-commit hook.🤖 This PR was generated by Coder Agents on behalf of @bpmct.