Prompt
Should I use Vault or just environment variables?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
Short answer: use Vault for secrets, environment variables for non-sensitive config.
Rule of thumb
- Environment variables: good for
- feature flags
- log levels
- app mode (
dev,staging,prod) - non-secret connection info
- Vault: good for
- database passwords
- API keys
- TLS certs/private keys
- tokens and anything you’d regret leaking
When environment variables are enough
Use env vars if:
- it’s a small app or early-stage project
- you have a single server or simple deployment
- secrets are not highly sensitive
- you can rotate secrets manually without much pain
- you don’t need audit trails, lease/rotation, or fine-grained access control
When Vault is worth it
Use Vault if:
- you have multiple services or environments
- secrets need to be rotated automatically
- you want centralized secret management
- you need access control and audit logs
- you’re in a regulated or security-sensitive environment
- you want to issue dynamic credentials (e.g. short-lived DB users)
A practical recommendation
For many teams:
- Put non-secret config in env vars
- Use Vault or a cloud secret manager for secrets
- Inject secrets into the runtime at deploy/startup if possible
Simpler alternatives to Vault
If Vault feels heavy, consider:
- AWS Secrets Manager / SSM Parameter Store
- GCP Secret Manager
- Azure Key Vault
- Kubernetes Secrets (better than plain env vars, but still be careful)
Important caveat
Environment variables are not truly secure:
- they can be exposed in process listings, crash dumps, logs, CI output, etc.
- they’re convenient, but not a secret store
Bottom line
- Small/simple app: env vars are fine, with care
- Anything production-critical with real secrets: prefer Vault or a managed secret store
If you want, I can help you choose based on your setup (language, cloud, Docker/Kubernetes, team size).