## Summary Adds a generic incident response page for Coder deployment administrators. It's split out of #32356 (disaster recovery) so each topic gets its own review. ## Changes - New `docs/admin/security/incident-response.md` (how-to), under Admin > Security: - A table that matches each incident type to its narrowest containment. A full cutoff is one option, for when the scope is unknown. - What each action blocks, and whether it ends open sessions. - Containment steps for leaked tokens, compromised users, and compromised owners, including break-glass password accounts. Leaked tokens are expired by their ID prefix, which also covers session tokens. - Dashboard, CLI, and REST API paths for each containment step, including a script that strips an owner's roles and suspends it. - After a compromised owner, an audit log query and a table of how to revoke each resource type it created. - Responses to a compromised PostgreSQL database, control plane, external provisioner, workspace proxy, or workspace. - A section on the credentials that workspace builds receive (owner session token, Git SSH key, OIDC and external auth tokens, template variables, parameters), which component exposes each, and how to rotate them, ending with a workspace restart. - Steps to cut off access to every workspace (including a site-wide suspend of non-owner users), then to investigate, restore access, and prevent common incidents. - Sidebar entry in `docs/admin/security/sidebar.yml`. ## Notes for reviewers - Owners can't be suspended, and you can't change your own roles (`coderd/users.go`, `putUserStatus` and `putUserRoles`). So the owner steps have another owner remove the role with `coder users edit-roles` first. With OIDC site-role sync on, Coder rejects the role change, so the page points to the IdP. - An owner can reset another owner's password. A reset through the dashboard or `PUT /api/v2/users/{user}/password` runs `DeleteAPIKeysByUserID` (`coderd/users.go`). `coder reset-password` (`cli/resetpassword.go`) only updates the hash, so the page tells readers to expire tokens separately after using it. - OIDC site role sync runs only at sign-in (`coderd/userauth.go`, `SyncRoles` in the OAuth login path). While `--oidc-user-role-field` is set, Coder also rejects role edits for OIDC users (`putUserRoles`). So removing Owner in the IdP doesn't contain a signed-in attacker. The page has the operator unset the flag and restart first. - `coder users edit-roles --yes` can't clear every site role: an empty `--roles` triggers the interactive picker, which `--yes` rejects (`cli/usereditroles.go`). The CLI tab keeps the other roles, and the REST API tab clears all of them. - `coder server create-admin-user` has no REST API equivalent, because granting Owner through the API needs owner credentials. - Not on the page: Coder rotates its signing keys (`crypto_keys`) every 30 days (`coderd/cryptokeys/rotate.go`) and has no command to rotate them early. That matters after a database compromise when database encryption is off. - Agent tokens rotate on every build. The Terraform provider generates a new token in both Create and Read (`terraform-provider-coder` v2.20.0, `provider/agent.go`), so a persistent `coder_agent` also gets a new token on each refresh. `GetAuthenticatedWorkspaceAgentAndBuildByAuthToken` accepts only tokens from the latest build, plus the previous start build while a stop or delete is running. Tokens are a plaintext `uuid` column that database encryption doesn't cover, so the database section says to restart every workspace. I verified this in source, not with a live restart, because the test workspace is the one running this agent. - I documented break-glass recovery publicly instead of in a Pylon KB article, because every command it uses already has a public reference page. That's open to change. - An owner can expire any user's key by ID, including password and OIDC session keys: `GET /users/{user}/keys/{keyid}` and `PUT .../expire` look the key up by ID and authorize against the key, not the path user (`coderd/apikey.go`). `coder tokens remove <id>` uses that fallback (`cli/tokens.go`). `tokens list --all` only returns `login_type=token` keys. - Provisioner jobs receive the owner session token, Git SSH private key, OIDC access token, external auth tokens, template variables, parameters, and Terraform state (`coderd/provisionerdserver/provisionerdserver.go`, `acquireProtoJob`). A start build replaces the owner session token and a stop build deletes it. Owners can't read or change another user's secrets (`coderd/rbac/roles.go`), so the page asks users to rotate their own. - Prebuild claims reuse the agent tokens from build 1 (`RunningAgentAuthTokens`), so the page says to delete unclaimed prebuilt workspaces to rotate them. - Provisioner keys aren't an audited resource and have no creator field, so the page says to delete keys by creation time. - Two things are verified in the code only, not run: suspension doesn't end open sessions, and stopping the control plane doesn't end direct sessions right away (`tailnet/configmaps.go`, `lostTimeout`). - The CLI stop-all pipeline isn't run against a live deployment. It's Bash and Zsh only. - There's no cross-link to the disaster recovery page yet, because that page isn't on `main`. I'll add one in whichever PR merges second. ## Testing - `make lint/emdash`, `make lint/docs-manifest`, and `make lint/docs-html` pass. - markdownlint and Vale on the new page: 0 findings. - Every shell snippet parses in Bash and Zsh (`-n`), and the jq filters were run against sample JSON in the API response shapes. - Relative links and in-page anchors resolve. - A temporary `coderdtest` test (not committed) confirmed: an owner can look up and expire another user's session key by ID; `tokens list --all` omits session keys; an owner can create a session key for another user that no token list shows, and a dashboard or API password reset deletes it; an owner can regenerate another user's Git SSH key. <details> <summary>Decision log</summary> - The first draft was `cut-off-workspace-access.md` in #32356. Review feedback asked for: - a generic incident response page, because cutting off workspace access isn't always the right response; - guidance for compromised Owner and break-glass accounts; - two wording fixes in the intro, which are applied. - I restructured the page as: choose a response, know what each action blocks, contain, cut off everything, investigate and restore, prevent. - I moved the "situations" table into a final prevention list, so the page opens with the response. - Second review round asked for: - dashboard, CLI, and REST API paths for each step; - a non-interactive owner containment script; - the OIDC note at the start of its section; - a site-wide suspend for when the scope is unknown; - a Premium callout; - coverage of compromised architecture components. - Third review round asked for: - expiring leaked tokens by ID prefix, because `tokens list --all` misses session tokens; - revoking what a compromised owner created, using the audit log; - rotating the owner credentials and stored secrets that a compromised provisioner, control plane, or database exposes, and restarting the affected workspaces. - I put the credential rotation in one shared section that each component links to, with a table of which component exposes which credential, instead of repeating the steps under each component. </details> --- _This PR was generated by Coder Agents on behalf of @nickvigilante._ --------- Co-authored-by: Lisa Fiander <lisa@coder.com>
title, markdown_url
| title | markdown_url |
|---|---|
| Home | /docs.md |
Coder Workspaces
Coder Workspaces are cloud development environments defined with Terraform, connected through a secure Wireguard tunnel, and automatically shut down when not in use. Agents and developers share the same workspace infrastructure.
- Defined in Terraform: Templates describe the infrastructure for each workspace, from Amazon Elastic Compute Cloud (EC2) VMs and Kubernetes Pods to Docker containers.
- Any architecture and OS: Support ARM and x86-64 across Windows, Linux, and macOS from a single deployment.
- Managed by admins: Platform teams create and maintain templates that enforce approved images, resource limits, and security policies.
- Accessed from any IDE: Connect through VS Code, JetBrains, Cursor, a web terminal, remote desktop, or SSH.
- Automatic shutdown: Idle workspaces stop automatically to reduce cloud spend, and restart in seconds when needed.
Coder Agents
Coder Agents is a native AI coding agent built into Coder. The agent loop runs in the Coder control plane on your infrastructure, not in the workspace and not in a vendor's cloud. Developers interact with agents through the web UI or the Representational State Transfer (REST) API for programmatic and continuous integration (CI)-driven workflows.
- Self-hosted agent loop: The control plane handles planning, model calls, and tool dispatch. Workspaces have zero AI awareness.
- No API keys in workspaces: large language model (LLM) credentials stay in the control plane.
- Any model: Anthropic, OpenAI, Google, Bedrock, or self-hosted endpoints. Switching is a configuration change.
- Governance and cost controls: Centralized model approval, per-user spend limits, and audit logging.
- Open source and inspectable: The full platform is available to audit and extend.
IDE support
You can use:
-
Any Web IDE, such as
- code-server
- JetBrains Projector
- Jupyter
- And others
-
Your existing remote development environment:
-
A file sync such as Mutagen
Why remote development
Provisioning consistent development environments for a large engineering team is difficult. Each developer has preferences for operating systems, editors, and toolchains, and providing a reliable build environment across all of them is a maintenance burden. A missed step during onboarding or an unsupported local configuration can cost hours of debugging.
Remote development solves this by moving the environment off the developer's machine and into managed infrastructure. The developer's laptop becomes a portal into the actual compute where work happens. If a device is lost or replaced, access is simply revoked. No source code or credentials are stored locally.
This approach provides:
- Speed: Server-grade hardware accelerates builds, tests, and large workloads without requiring expensive local machines.
- Consistency: Infrastructure tools such as Terraform, nix, Docker, and Dev Containers produce identical environments for every developer.
- Security: Source code stays on private servers. Users and groups are managed through single sign-on (SSO) and role-based access control (RBAC).
- Compatibility: Workspaces share infrastructure configurations with staging and production, reducing configuration drift.
- Accessibility: Browser-based IDEs and remote IDE extensions let developers work from any device, including lightweight laptops, Chromebooks, and tablets.
Read more on the Coder blog, the Slack engineering blog, or from Alex Ellis at OpenFaaS.
Why Coder
The key difference between Coder and other platforms is that the entire system, agent loop, control plane, model routing, and workspace provisioning, runs on infrastructure you control.
For agents, this means platform teams can:
- Run the entire agent loop on their infrastructure, with no SaaS dependency for orchestration.
- Define Model Context Protocol (MCP) servers, skills, and system prompts centrally so every agent session starts with the same tools, policies, and context.
- Keep LLM credentials out of workspaces entirely.
- Tie every agent action to an authenticated user identity.
- Support air-gapped and restricted-network deployments with self-hosted models.
For workspaces, this means admins can:
- Support any architecture (ARM, x86-64) and operating system (Windows, Linux, macOS).
- Modify pod/container specs, such as adding disks, managing network policies, or setting/updating environment variables.
- Use VM or dedicated workspaces, developing with Kernel features (no container knowledge required).
- Enable persistent workspaces, which are like local machines, but faster and hosted by a cloud service.
Pricing
Coder is free and open source under the GNU Affero General Public License v3.0. All developer productivity features are included in the open source version. A Premium license is available for enhanced support and custom deployments.
How Coder works
Coder workspaces are represented with Terraform, but you do not need to know Terraform to get started. The Coder Registry provides production-ready templates for AWS EC2, Azure, Google Cloud, Kubernetes, and other providers.
Providers and compute environments
Workspaces can include more than just compute. Terraform can add storage buckets, secrets, sidecars, and other resources.
See the templates documentation for details.
What Coder is not
-
Coder is not an infrastructure as code (IaC) platform.
Terraform is the first IaC provisioner in Coder, allowing Coder admins to define Terraform resources as Coder workspaces.
-
Coder is not a DevOps/CI platform.
Coder workspaces can be configured to follow best practices for cloud-service-based workloads, but Coder is not responsible for how you define or deploy the software you write.
-
Coder is not an online IDE.
Coder supports common editors, such as VS Code, vim, and JetBrains, all over HTTPS or SSH.
-
Coder is not a collaboration platform.
You can use Git with your favorite Git platform and dedicated IDE extensions for pull requests, code reviews, and pair programming.
-
Coder is not a SaaS/fully-managed offering.
Coder is a self-hosted solution. You must host Coder in a private data center or on a cloud service, such as AWS, Azure, or GCP.

