Prerequisites
Before configuring Mage:- Create a Doppler project and config.
- Add the secrets that Mage needs to the config.
- Create a service token with access to that config. Prefer a dedicated, read-only token for each Mage environment.
Configure Mage
Set these environment variables on every Mage process that renders configuration containing Doppler references:
For example:
DOPPLER_TOKEN in io_config.yaml, pipeline code, or version control.
Reference a secret
Usedoppler_secret_var anywhere Mage template variables are supported:
io_config.yaml profile can retrieve multiple values from the default Doppler project and config:
Override the project or config
The environment variables define the defaults. Passproject or config for a reference that should use a different Doppler scope:
DOPPLER_TOKEN, so that token must be authorized to read every referenced project and config.
Cache behavior and secret rotation
Mage caches the complete secret set for each API host, project, and config in process memory. The default cache lifetime is 10 seconds. References to the same scope reuse that cached result until its TTL expires. SetDOPPLER_SECRETS_CACHE_TTL_SECONDS=0 to disable caching. This makes secret changes available on the next template render, but increases Doppler API traffic and makes rendering more sensitive to temporary network failures. A negative TTL is treated as 0.
After the TTL expires, Mage fetches the config again on the next lookup. Existing database connections and clients may continue using an older credential until they are recreated.
Troubleshooting
Missing Doppler configuration
If Mage reports missingDOPPLER_TOKEN, DOPPLER_PROJECT, or DOPPLER_CONFIG, confirm the variables are present in the environment of the Mage process, then restart it. Setting them only in an interactive shell does not update an already-running deployment.
Secret not found
Confirm that the secret name is exact and case-sensitive, the selected project and config contain it, and the service token can read that scope. Check per-referenceproject and config overrides as well as the defaults.
Doppler API request fails
Verify that Mage can reachhttps://api.doppler.com, the service token is valid, and the project and config identifiers are correct. If your environment uses a proxy or a custom Doppler API endpoint, set DOPPLER_API_HOST to the reachable base URL without a trailing path.
A rotated value is not used immediately
Wait forDOPPLER_SECRETS_CACHE_TTL_SECONDS to elapse and trigger another template render. Recreate any open database connection or client that was initialized with the previous value. For rotation-sensitive workloads, temporarily reduce the TTL or set it to 0, considering the additional API traffic.
Security recommendations
- Use a separate Doppler service token for each Mage environment.
- Grant the token access only to the projects and configs that environment requires.
- Store the token in your deployment platform’s protected environment configuration, not in Mage project files.
- Rotate tokens and application credentials regularly, and revoke unused tokens.
- Avoid logging rendered configuration or secret values.