Comparing AWS Secrets Manager, Google Secret Manager, HashiCorp Vault, OpenBao, Infisical, Doppler, 1Password and SOPS for application secrets, plus Encore's secrets declared in code.
A secrets manager stores API keys, database passwords and signing keys outside the code and hands them to the app at runtime. Storing them is well understood, and the harder work is keeping local, preview and production values in step, rotating them and tracking which service reads which secret.
This guide compares eight tools by where secrets live, how they reach the app and how they work locally. It also includes Encore, where secrets are declared in backend code.
What you need to decide:
AWS Secrets Manager stores secrets encrypted with KMS, controls access with IAM and logs reads to CloudTrail. It rotates RDS and other credentials with managed or Lambda-based rotation, and ECS and Lambda can inject values at startup. Reading a secret from code is one SDK call:
import { SecretsManagerClient, GetSecretValueCommand } from "@aws-sdk/client-secrets-manager";
const client = new SecretsManagerClient({});
const { SecretString } = await client.send(
new GetSecretValueCommand({ SecretId: "prod/stripe" }),
);
Pricing is per secret per month plus API calls, so caching values in the process matters at high request rates. Local development has no equivalent, and each service needs an IAM policy for each secret.
Google Secret Manager stores versioned secrets per project with IAM access per secret and audit logs. Cloud Run can mount a secret as an environment variable or a file, which avoids SDK code:
Like the AWS service, it covers deployed environments only, and local values are handled separately.
Vault covers the widest range of features on this list. Beyond key-value storage, it issues dynamic database and cloud credentials that expire, acts as a certificate authority and encrypts data as a service. Apps authenticate with Kubernetes, AWS IAM or other methods and read through the API, the Vault Agent or a sidecar.
Running Vault well means high availability, unsealing, backups and policy management, which is a platform team's job. HCP Vault is the managed option. HashiCorp moved Vault and Terraform to the Business Source License in 2023. The Terraform change prompted the OpenTF fork, now OpenTofu.
OpenBaoOpenBao is a fork of Vault's last open source release, maintained under the Linux Foundation with the MPL 2.0 license. Its API and most engines are compatible with Vault, so existing clients and policies carry over, and it is developed in the open with its own roadmap. It brings the same operational load as self-hosted Vault.
InfisicalInfisical is an open source secrets platform with a dashboard for projects and environments, secret versioning, rotation and a Kubernetes operator, available as a hosted service or self-hosted. The CLI injects values into any command, which covers local development:
Production apps still need a machine identity and either the SDK, the operator or a sync into the cloud's own manager.
DopplerDoppler organises secrets into projects and configs per environment and syncs them into AWS Secrets Manager, Google Secret Manager, Vercel, GitHub Actions and many other targets. doppler run -- npm start injects values locally. It suits teams deploying to several platforms that want one source of truth, and it is hosted only.
1Password's developer tools let .env files reference vault items instead of holding values, and op run resolves them when a command starts:
# .env
STRIPE_KEY="op://Shop/Stripe/secret-key"
op run reads that file, resolves each reference and starts the command with the values in its environment:
Service accounts and Connect servers cover CI and production. It fits teams that already keep credentials in 1Password, with fewer infrastructure features such as dynamic credentials.
SOPSSOPS encrypts the values in YAML, JSON or env files with age, PGP or a cloud KMS key, leaving the keys readable, so encrypted secrets live in Git next to the code and diff cleanly. It is popular with Flux and Argo CD. There is no server and no audit log of reads, and rotation means re-encrypting and committing.
In Encore, a secret is declared in backend code and read by calling it:
import { secret } from "encore.dev/config";
const stripeKey = secret("StripeSecretKey");
Values are set per environment type with encore secret set or the dashboard, and local values sync to everyone working on the app, with a .secrets.local.cue file for per-machine overrides. A missing secret is a warning locally and a failed deploy in the cloud. On deploy, Encore copies values from its vault into AWS Secrets Manager or Google Secret Manager in your account, as part of the AWS infrastructure or GCP equivalent it provisions. External vaults can reference values kept in Google Secret Manager instead. It only applies to apps built with Encore.
Leaked keys usually come from code rather than from the secrets store. GitGuardian counted about 23.8 million new hardcoded secrets in public GitHub repositories in 2024, and found that most secrets leaked in 2022 were still valid two years later, as InfoQ reported. Whatever the tool, use one secret per purpose and separate values per environment, run a scanner on the repository, rotate anything that has been committed and keep secrets out of logs and error reports.
For apps on one cloud, that cloud's manager, AWS Secrets Manager or Google Secret Manager, is the default because IAM already controls access. Vault and OpenBao suit platform teams that need dynamic credentials across clouds, Infisical and Doppler suit teams that want one dashboard for every environment, and SOPS suits teams that keep encrypted secrets in Git.
Declare it at the top level with const stripeKey = secret("StripeSecretKey") from encore.dev/config and call stripeKey() where you need the value. Set it with encore secret set --type prod StripeSecretKey for production and --type dev,preview,local for the rest, and Encore checks that every declared secret is set before it runs or deploys.
Environment variables are the most common way to hand a secret to a process, and most tools on this list inject them. They leak easily through crash reports, debug pages and child processes, so keep the set small, never log the environment and prefer reading secrets once at startup from a manager.
No. HashiCorp moved Vault to the Business Source License in 2023. OpenBao is a fork of the last open source version, maintained under the Linux Foundation with the MPL 2.0 license and a largely compatible API.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.