Why Secret Managers Don't Solve the API Key Problem
HashiCorp Vault, AWS Secrets Manager, and Doppler are the right tools for managing secrets at scale. They are also frequently misunderstood as solutions to API key theft. They are not - and the gap they leave is where most incidents happen.
What secret managers actually do
Secret managers solve a real and important problem: keeping credentials out of source code and centralising secret lifecycle management. Before they existed, the industry standard was hardcoded credentials, .env files committed to git, and shared credentials on Slack. Secret managers are a massive improvement over that baseline.
The pattern they enable is:
1. Developer stores OPENAI_API_KEY=sk-proj-real... in Vault/AWS SM/Doppler
2. At deploy time, CI pipeline fetches the secret via the secret manager API
3. Secret is injected as an environment variable into the running container
4. Application reads process.env.OPENAI_API_KEY at runtimeThis is better than keeping secrets in source code. But it does not eliminate the real credential from the deployment environment - it just centralises where the credential is fetched from before landing in an environment variable.
The gap: injection vs. proxying
The fundamental limitation is this: secret managers inject the real credential into your process. The real key ends up in memory, in process environment space, potentially in logs if something crashes, and definitely in the CI pipeline log if your deployment system echos environment variables.
Attack surfaces that secret managers don't close
- ▸CI/CD pipeline environment variable logs (often public in open-source repos)
- ▸Container image layers that bake in env vars at build time
- ▸Process environment dumps from crash reports or APM tools
- ▸Supply chain attacks on build dependencies with process.env access
- ▸Misconfigured secrets rotation that leaves old keys in deployment env
- ▸Developer laptops that cache fetched secrets locally
The real credential is still touching your infrastructure. It just arrives via a more controlled channel than a hardcoded string. The risk surface narrows, but it does not disappear.
HashiCorp Vault
Vault is an outstanding tool for enterprises managing hundreds of secrets across complex infrastructure. Dynamic secrets, lease management, and audit logging make it one of the most capable secret backends available.
What Vault cannot do: it cannot intercept an API request made with a real credential and validate that request against an origin policy. Once Vault hands the credential to a process, Vault's job is done. If that process is compromised, the credential is compromised.
Vault is excellent at the “how do I store and distribute secrets” problem. It does not address the “how do I make the credential itself worthless if exfiltrated” problem.
AWS Secrets Manager
AWS Secrets Manager adds automatic rotation for certain credential types, which is genuinely valuable. Shorter-lived credentials reduce the blast radius of a leak because an old key becomes invalid quickly.
But automatic rotation does not help when the currently-valid credential is the one that was exfiltrated. The 8-minute exploit window is shorter than any rotation interval in practice. And rotation solves the “minimize damage” problem - it does not solve the “prevent the credential from being usable outside your systems” problem.
Doppler and similar SaaS tools
Doppler, Infisical, and similar developer-focused tools solve the developer experience problem well - syncing secrets across environments, managing access control per team, integrating with CI systems. The DX is much better than Vault for smaller teams.
The security model is the same, however: the tool fetches the real credential and injects it into your process. The convenience is higher; the fundamental exposure is the same.
Closing the gap with a proxy layer
Secret managers and edge proxies are complementary, not competing. The right architecture uses both:
Secret manager layer
Stores and manages the real API key with access controls, audit logging, and rotation. The real key never leaves this layer to developer machines or CI pipelines.
Edge proxy layer
Reads the real key from the secret manager at runtime, in an isolated execution context. Issues sanitized host-bound tokens to developers. Proxies requests, validating origin before injecting the real key into the upstream request.
Developer environment
Only ever holds a sanitized token. Leaking it has zero consequence. The real key is never on developer machines, in CI logs, or in deployment env vars.
Close the gap in 5 minutes
KeyVault Edge adds the proxy layer your secret manager is missing. Keep using Vault or AWS SM for storage - replace the credential in your deployment with a host-bound token that's worthless outside your domain.
Get started free