Skip to content

docs: add sandbox agents guide and startup time tips - #32280

Merged
bpmct merged 9 commits into
mainfrom
docs/sandboxing-workspaces
Nov 17, 2026
Merged

bpmct merged 9 commits into
mainfrom
docs/sandboxing-workspaces

Conversation

@bpmct

@bpmct bpmct commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

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.

  • Starts with the coder-labs registry templates (agent-sandbox, Plain Sandbox, OpenShell) that implement all three, and calls out agent-sandbox.
  • Explains what the sandbox covers for CLI Agents, Coder Agents, and Agent Relay.
  • Shows how to define sandbox profiles as immutable parameters with one preset each, and how to control which profile an agent gets.
  • Kernel: gVisor, Kata, and EKS Nitro Sandboxes (isolated-sandbox RuntimeClass in EKS Auto Mode).
  • Network: separate proxy Pod vs. sidecar, example rules using an internal GitHub and artifact store, and a cloud firewall layer (AWS Network Firewall, Route 53 Resolver DNS Firewall) that also limits DNS.
  • Secrets: api_key_scope = "no_user_data", a scoped AI Gateway token (skipped for prebuilds, optional lifetime), 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:

Decisions and checks
  • Structure: three traits, several ways to get each, and simple tradeoffs.
  • Sysbox is not listed as kernel isolation, because system calls still reach the node's kernel.
  • Deployments stay the recommendation over bare Pods, because wait_for_rollout and coder-logstream-kube cover the startup and error cases.
  • Token lifetime is left commented out in the example: Coder can't revoke the token at stop, and a lifetime shorter than autostop breaks running workspaces.
  • Process logging wording: the eBPF sidecar runs inside the sandbox with gVisor, Kata, or Nitro, so the page asks readers to test it.
  • "CLI Agents" is kept as the term for agents that run fully in the workspace.
  • Verified in code:
    • mutable = false is enforced on later builds (coderd/dynamicparameters/resolver.go).
    • Presets match by subset, also without a preset_id (coderd/database/queries/prebuilds.sql, coderd/workspaces.go).
    • no_user_data blocks the Git SSH key and external auth (coderd/gitsshkey_test.go, coderd/externalauth_test.go).
    • Token creation is rejected for the prebuilds system user (coderd/apikey.go), and the default token lifetime is 7 days (codersdk/deployment.go).
    • No Coder code sets CODER_SESSION_TOKEN in a workspace; registry modules such as coder-login do.
  • Checks run: 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.

@bpmct
bpmct temporarily deployed to main November 16, 2026 19:48 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 16, 2026 19:48 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 16, 2026 21:04 — with GitHub Actions Inactive
@bpmct bpmct changed the title docs: add sandbox workspaces guide docs: add sandboxing agents guide Nov 16, 2026
@bpmct
bpmct temporarily deployed to main November 16, 2026 21:04 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 16, 2026 21:13 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 16, 2026 21:14 — with GitHub Actions Inactive
@bpmct
bpmct marked this pull request as ready for review November 17, 2026 13:28
@bpmct
bpmct temporarily deployed to main November 17, 2026 13:28 — with GitHub Actions Inactive
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.
@bpmct
bpmct temporarily deployed to main November 17, 2026 13:30 — with GitHub Actions Inactive
@bpmct bpmct changed the title docs: add sandboxing agents guide docs: add sandboxing agents guide and startup time tips Nov 17, 2026
@bpmct
bpmct temporarily deployed to main November 17, 2026 13:31 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 13:45 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 13:45 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 14:33 — with GitHub Actions Inactive
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.
@bpmct
bpmct temporarily deployed to main November 17, 2026 14:34 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 14:34 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 14:36 — with GitHub Actions Inactive
@bpmct
bpmct temporarily deployed to main November 17, 2026 14:37 — with GitHub Actions Inactive

@nickvigilante nickvigilante left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_prebuild guard 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).

Comment thread docs/reference/glossary.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved

@nickvigilante nickvigilante left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

@daveahr2172 daveahr2172 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. AWS Nitro Sandboxes as a kernel isolation option
  2. A lifetime and revocation for the AI Gateway token example
  3. Agent Firewall marked as phased out but still recommended
  4. A cloud egress firewall layer
  5. Per-workspace scope for Pod Identity
  6. Caveats for the start-up tips
  7. 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.

Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
Comment thread docs/workspaces/speed-up-templates.md Resolved
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.
@bpmct
bpmct temporarily deployed to main November 17, 2026 19:05 — with GitHub Actions Inactive
@bpmct bpmct changed the title docs: add sandboxing agents guide and startup time tips docs: add sandbox agents guide and startup time tips Nov 17, 2026
@bpmct
bpmct temporarily deployed to main November 17, 2026 19:05 — with GitHub Actions Inactive
@bpmct
bpmct merged commit ed9e9a8 into main Nov 17, 2026
34 of 36 checks passed
@bpmct
bpmct deleted the docs/sandboxing-workspaces branch November 17, 2026 19:52
@bpmct
bpmct temporarily deployed to main November 17, 2026 19:52 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 17, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — 66868036 Deployed Nov 17, 2026 by bpmct via cleanup #177
main — 66868036 Deployed Nov 17, 2026 by bpmct via cla #258915
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants