Guides / Infisical secret rotation
Automatic secret rotation with Infisical
A vault and rotating keys are the cheapest protection against leaks from AI coding sessions. What Infisical does for free, what rotation costs, how to self-host it, and a four-week plan.
Why rotation matters more with AI-built apps
AI coding sessions read configuration files, copy keys into code to make things work, and commit faster than anyone reviews. A key that changes on a schedule limits how long a leaked copy is useful, and a vault means nobody needs to paste keys anywhere in the first place.
What Infisical is, and what is free
Infisical is an open-source secrets platform: a vault for keys, with environments, access control, audit logs and integrations. Be precise about what costs money, because the self-hosting story is often oversold:
| Capability | Free (cloud or self-hosted) | Paid |
|---|---|---|
| Vault, projects, environments | Yes (MIT-licensed core) | - |
| Apps reading secrets (CLI, SDKs, Kubernetes operator, agent) | Yes | - |
| Audit logs | Limited | Pro: 30 days; Advanced: 90 days; Enterprise: custom |
| Automatic secret rotation | No: rotation is in the enterprise code | Pro: public databases only. Advanced and Enterprise: full rotation |
| Dynamic secrets (short-lived credentials) | No | Advanced and Enterprise |
| Self-hosting with paid features | Core only | Requires an enterprise licence key |
Infisical prices per identity per month (annual billing)
What Infisical can rotate
Supported rotation providers include AWS IAM user keys, Azure client secrets, Google Cloud service account keys, PostgreSQL, MySQL, Microsoft SQL Server, MongoDB, Redis, Supabase API keys, Stripe API keys, OpenAI service accounts, Cloudflare API tokens, Auth0, Okta and Databricks, among others. Most use two phases: a new credential is created and the old one is removed only after everything has switched, so apps do not break mid-rotation.
How it fits together
Secrets with Infisical
Self-hosting Infisical
Self-hosting makes sense when secrets must never leave your infrastructure. Infisical documents several ways: a single Docker container, Docker Compose with PostgreSQL and Redis, a Kubernetes Helm chart, a Linux package, and reference setups on AWS (ECS Fargate, RDS, ElastiCache) and Google Cloud.
# Run an app with secrets injected, without writing them to disk
infisical login
infisical run --env=prod -- npm start
- Back it up like a database, because it is one: PostgreSQL holds every secret, encrypted.
- Protect the encryption key outside the machine. Losing it means losing every secret.
- Budget for the licence if you need rotation or dynamic secrets on a self-hosted instance.
- Or use the cloud's own vault when you only need storage: AWS Secrets Manager rotates some credentials natively, and Azure Key Vault integrates with Azure services.
A rotation plan for a small team
Rotation in four weeks
- 1Week 1Move every secret into the vault; remove keys from code, chats and builder settings.
- 2Week 2Apps read from the vault (CLI, SDK or agent); separate keys per environment.
- 3Week 3Rotate database and cloud credentials on a schedule, starting with staging.
- 4Week 4Alerts on failed rotations; a written runbook for a leaked key.
Related guides
- Tools that find API keys in AI-written code
- What to do when a key reaches GitHub
- The launch checklist for vibe-coded apps
Sources
Checked on 2 December 2026. Prices and product names change; the linked pages are the reference.
How I help
I set up the vault, move every key into it, wire your apps to read from it, and turn on rotation where it pays off.
- Secrets setup (fixed price): vault, keys moved, apps wired, history scanned, Claude Code deny rules.
- Rotation: schedules for database and cloud credentials, alerts and a leak runbook.
- Operate: from $4,999 per month as part of running your systems.
Done by a Claude Certified Architect and Certified Lovable Expert. Everything stays in your accounts.
Questions
Is Infisical free to self-host?
The MIT-licensed core is free to self-host: the vault, environments and secret delivery. Rotation, dynamic secrets and longer audit retention are paid features that need a licence key.
Does Infisical rotate secrets on the free plan?
No. Pro rotates public database credentials; Advanced and Enterprise include full rotation.
Infisical or AWS Secrets Manager?
Secrets Manager if everything runs in one AWS account. Infisical when you have several clouds, local development and builder platforms to cover with one vault.
How often should keys rotate?
Critical credentials such as database passwords and cloud keys: on a schedule, typically 30 to 90 days, and immediately after any suspected leak.
Start with a conversation
Thirty minutes, no charge. Tell me what you have built and where it stopped. If I am not the right person, I will say so and point you somewhere better.
Calendar not loading? Open the booking page or email me.