Docs / Secrets and data / Passwords and keys
Passwords and keys
Your keys live in your password manager, and your agent runs a command that fetches one at the moment it is needed. The one thing CommonRig keeps is a key an integration here needs to run, entered once and kept encrypted: see Integrations and keys.
Why keys never go in
- A key written into CommonRig would sit in a hosted store, in your nightly repo copy and in your agent's context. In a manager, it sits in none of them.
- Anything you paste that looks like a key is masked on the way in.
- You can say where a key lives, in a credential record or in plain words, but never its value. The one exception is a key an integration on our side needs, such as a webhook's signing secret: Integrations and keys.
Three managers side by side
| 1Password | Bitwarden Secrets Manager | HashiCorp Vault | |
|---|---|---|---|
| A reference looks like | op://Dev/OpenRouter/credential | A secret id | secret/data/myapp, field api_key |
| Run a command with keys | op run --env-file .env -- <command> | bws run -- '<command>' | vault kv get into the command, or Vault Agent |
| On a machine with nobody there | A service account token | A machine account access token | Vault Agent with its own sign-in |
| Good for | People who already use 1Password | Teams wanting a free tier for machines | Self-hosted, long-running services |
1Password
Put a reference in an env file, never the value. op run swaps each reference for the real value in the command's environment only.
OPENROUTER_API_KEY=op://Dev/OpenRouter/credentialop run --env-file .env -- npm run startHeadless, with no person to unlock the app: create a service account and set OP_SERVICE_ACCOUNT_TOKEN in that machine's environment. op run then works the same. Docs: developer.1password.com/docs/cli/secrets-environment-variables.
Bitwarden Secrets Manager
A machine account gets an access token that reaches only the projects you give it. bws run puts each secret in the command's environment under the secret's name.
BWS_ACCESS_TOKEN=<the machine account token>bws run -- 'npm run start'bws run --project-id <project id> -- 'npm run start'bws secret get <secret id> prints a JSON object with the value in it, so prefer bws run. Flags change between versions: check bws --help. Docs: bitwarden.com/help/secrets-manager-cli.
HashiCorp Vault
Secrets live at a path in the key-value store. Read one field on demand, or have Vault Agent write it for a long-running service.
vault kv get -mount=secret -field=api_key myapp{{ with secret "secret/data/myapp" }}{{ .Data.data.api_key }}{{ end }}Vault Agent re-renders the file as the secret changes. For an environment variable instead, use an env_template block in process supervisor mode. Docs: developer.hashicorp.com/vault/docs/agent-and-proxy/agent/template.
Checked against the code at e28af69c. Site built from f04f4af1.