For more information about how to use secrets and other security tips, visit our guide to [security best practices](security-best-practices.md#secrets).
Use this guide to configure how templates make secrets available to Coder workspaces.
To authenticate workspace provisioners with Coder, see the <a href="../../install/operate/provisioners/index.md#authentication">provisioners documentation</a>.
You can do everything you can locally and more with your Coder workspace, so whatever workflow and tools you already use to manage secrets can be brought over.
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](./database-encryption.md) when it is enabled.
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.
A catch-all variation of this approach is dynamically provisioning a cloud service account (for example, [GCP](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_service_account_key#private_key)) for each workspace and then making the relevant secrets available via the cloud's secret management system.
While you can inject secrets into the workspace via environment variables, you can also show them in the Workspace UI with [`coder_metadata`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/metadata).