Files
coder/docs/admin/security/secrets.md
T
Nick Vigilante 7eacfe95b2 feat: enable Coder.LatinAbbreviations Vale rule (#30794)
Builds on #30782, which is merged; the branch now merges `main`.

Adds `Coder.LatinAbbreviations`, a Vale rule that enforces [Latin
abbreviations](https://github.com/coder/coder/blob/main/docs/.style/style-guide/accessibility-and-inclusion.md#latin-abbreviations).

- Suggests "for example", "that is", and "and so on" for `e.g.`, `i.e.`,
and `etc.`, including `eg.`, `ie.`, and a missing final period (`e.g`).
- Severity: `suggestion`. Scope: `docs/**` except
`docs/.style/style-guide/**`, limited to paragraphs, lists, headings,
and blockquotes. Table cells and code are skipped.
- Baseline: 170 findings in 91 files. The brief estimated 148.
- Cleanup: 153 findings fixed across 81 hand-written pages, 0 left in
linted pages. The count is lower than the original 158 because other PRs
on `main` already rewrote or removed some of the lines, and
`parameters.md` was deleted on `main`.
- `vs.` and `et al.` aren't flagged.

Commits:

1. `docs(docs): use English forms of Latin abbreviations`
2. `feat(docs/.style): enable Coder.LatinAbbreviations Vale rule`

Generated pages: `.vale.ini` skips `docs/reference/{api,cli}/*.md` and
`docs/admin/setup/configuration-reference.md` for this rule, as it does
for `Coder.UnitSpacing`.
Their prose comes from CLI flag help text and Swagger comments in Go
source, and `make gen` rewrites them, so a hand edit fails the `gen`
check (an earlier revision of this PR edited
`configuration-reference.md` and failed `gen` for that reason).
Cleaning them means editing Go and regenerating the help golden files
and API docs, which is left for a follow-up.

Linear: DOCS-450

<details>
<summary>Decision log</summary>

- `extends: substitution`, so the message names the replacement:
"Consider 'for example' instead of 'e.g.'".
- `scope: [paragraph, list, heading, blockquote]`. The single scope
`paragraph` skips list items, blockquotes, and headings, so all four are
listed. Table cells have their own scope and stay excluded.
- Explicit `[Ee]` and `[Ii]` classes with `ignorecase: false`, so
sentence-initial `E.g.,` still matches but the browser name `IE.`
doesn't.
- `eg.` and `ie.` require the trailing period so ordinary words and file
extensions stay quiet.
- Cleanup rules, applied by script and then reviewed line by line:
- `e.g.` and `i.e.` become "for example," and "that is," (capitalized at
the start of a sentence), with a comma added when the original had none.
- `etc.` becomes "and so on", with the sentence-ending period kept when
`etc.` closed the sentence.
- Lines inside table rows, fenced blocks, and code spans are untouched,
so are the style guide and the generated pages.
  - Hard-wrapped lines keep their wrapping, and CRLF files keep CRLF.
- The rest of the Vale output is unchanged: the per-rule counts for
every other rule match the pre-cleanup run.

Test cases (fixtures under `/tmp/latin-test/`, not committed), run with
LF and CRLF line endings:

- Flagged (15 each): `e.g.,` in a paragraph, `i.e.,`, `etc.` at the end
of a sentence and before a comma, `eg.`, `ie.`, `e.g` and `i.e` without
the final period, `E.g.,`, `I.e.,`, `Etc.`, a blockquote, a list item, a
numbered item, and a heading.
- Not flagged: a table row with `e.g.,`, `i.e.,`, and `etc.`, code
spans, a fenced block, "for example", "that is", "and so on", `IE.`,
`genre`, `series`, `egg`, `tie`, `etcetera`, `vs.`, `et al.`.
- Known edge case: a path-like token such as `path/i.e/x` outside code
matches. It doesn't occur in the corpus.

Checks:

- `vale --output=line docs/`: 0 `Coder.LatinAbbreviations` findings.
- `go run ./scripts/styleclaims` passes.
- The pre-commit-light hook passes on both commits.

</details>

*Generated by [Coder Agents](https://coder.com/docs/ai-coder/agents) on
behalf of @nickvigilante.*
2026-10-23 22:27:18 -07:00

5.3 KiB

title
title
Secrets

Coder is open-minded about how you get your secrets into your workspaces. For more information about how to use secrets and other security tips, visit our guide to security best practices.

Use this guide to configure how templates make secrets available to Coder workspaces. To authenticate workspace provisioners with Coder, see the provisioners documentation. For secret values that developers manage themselves, see User secrets.

Before you begin

Your first attempt to use secrets with Coder should be your local method. You can do everything you can locally and more with your Coder workspace, so whatever workflow and tools you already use to manage secrets may be brought over.

Often, this workflow is simply:

  1. Give your users their secrets in advance
  2. Your users write them to a persistent file after they've built their workspace

Warning

Template parameters are a dangerous way to accept secrets. Coder shows parameter values in cleartext throughout the product. Assume anyone with view access to a workspace can also see its parameters.

SSH Keys

Coder generates SSH key pairs for each user. This can be used as an authentication mechanism for git providers or other tools. Within workspaces, git will attempt to use this key within workspaces via the $GIT_SSH_COMMAND environment variable.

Users can view their public key in their account settings:

SSH keys in account settings

Note

SSH keys are never stored in Coder workspaces, and are fetched only when SSH is invoked. The keys are held in-memory and never written to disk.

User secrets

User secrets are developer-managed values that Coder injects at workspace start. If a user secret targets the same environment variable name or file path as a template-provided variable or file, Coder injects the user secret into that workspace. A secret can be disabled, in which case it is stored but not injected until it is re-enabled. User secret values are covered by Database Encryption when it is enabled. See the User secrets guide.

Workspace secrets

Workspace secrets are per-workspace values supplied on the workspace create or workspace build API request instead of as template parameters. They are meant for automation that provisions workspaces on a user's behalf and needs to hand the workspace a credential without exposing it as a parameter.

Unlike parameters, workspace secrets are never sent to the provisioner, so they do not appear in build parameters, Terraform state, template insights, or metrics. Coder delivers them only through the workspace agent, the same way as user secrets, and they cannot be read back through the API.

Dynamic Secrets

Dynamic secrets are attached to the workspace lifecycle and automatically injected into the workspace. With a little bit of up front template work, they make life simpler for both the end user and the security team.

This method is limited to services with Terraform providers, which excludes obscure API providers.

Dynamic secrets can be implemented in your template code like so:

resource "twilio_iam_api_key" "api_key" {
  account_sid   = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  friendly_name = "Test API Key"
}

resource "coder_agent" "main" {
  # ...
  env = {
    # Let users access the secret via $TWILIO_API_SECRET
    TWILIO_API_SECRET = "${twilio_iam_api_key.api_key.secret}"
  }
}

A catch-all variation of this approach is dynamically provisioning a cloud service account (for example, GCP) for each workspace and then making the relevant secrets available via the cloud's secret management system.

Display secrets

While you can inject secrets into the workspace via environment variables, you can also show them in the Workspace UI with coder_metadata.

Secrets UI

Can be produced with

resource "twilio_iam_api_key" "api_key" {
  account_sid   = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  friendly_name = "Test API Key"
}


resource "coder_metadata" "twilio_key" {
  resource_id = twilio_iam_api_key.api_key.id
  item {
    key   = "Username"
    value = "Administrator"
  }
  item {
    key       = "Password"
    value     = twilio_iam_api_key.api_key.secret
    sensitive = true
  }
}

Secrets Management

For more advanced secrets management, you can use a secrets management tool to store and retrieve secrets in your workspace. For example, you can use HashiCorp Vault to inject secrets into your workspace.

Refer to our HashiCorp Vault Integration guide for more information on how to integrate HashiCorp Vault with Coder.

Next steps