Prompt
Do I need to use a secrets manager or are env vars enough for a production app?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
Env vars are often enough for many production apps, but a secrets manager is the safer default once your app has real operational risk, multiple environments, or any compliance requirements.
Short answer
- Small/simple production app: env vars can be acceptable.
- Growing app / team / sensitive data / regulated environment: use a secrets manager.
When env vars are usually fine
Use env vars if:
- You have a small number of secrets
- Deployment is simple and controlled
- Only a few trusted people can access the server/CI/CD
- You rotate secrets manually and infrequently
- You’re okay with relying on your platform’s secret injection mechanism
Examples:
- A single VM
- A basic container deployment
- A prototype or low-risk internal app
When a secrets manager is the better choice
Use a secrets manager if:
- You have many secrets across services/environments
- You need rotation or short-lived credentials
- Multiple developers/teams deploy to the same systems
- You use Kubernetes, microservices, or CI/CD pipelines heavily
- You need audit logs, access control, or compliance
- You want to reduce the risk of secrets leaking via logs, dumps, config files, or shell history
Examples:
- AWS Secrets Manager / SSM Parameter Store
- GCP Secret Manager
- Azure Key Vault
- HashiCorp Vault
- Doppler, 1Password Secrets Automation, etc.
Important nuance: env vars are not “secure storage”
Env vars are better than hardcoding secrets, but they have weaknesses:
- They can leak through process listings, crash dumps, debug tooling, or misconfigured logs
- They’re often copied into deployment manifests or CI settings
- They’re usually static and not ideal for rotation
- Anyone with sufficient access to the runtime can often read them
So env vars are more like delivery mechanism than secret management.
Good practical rule
- Use env vars for app configuration and as a simple way to inject secrets at runtime.
- Use a secrets manager to store, rotate, audit, and distribute those secrets.
In other words: env vars can be the final hop, but not the system of record.
Recommended approach
If you’re unsure:
- Start with env vars for simplicity
- Make sure secrets are never committed to git
- Put rotation and access control on your roadmap
- Move to a secrets manager when the app or team grows
If you want, I can also give you a decision checklist for your specific stack (Docker, Kubernetes, AWS, etc.).