How Fly.io Replaced Vault for Customer Secret Reads
Brief
Fly.io replaced Vault as the source for customer secret reads with Petsem, prioritizing faster regional reads and limiting which secrets each worker can access.
Why Fly.io built Petsem
- Vault reads had a p99 latency of 10 seconds, and app boot depended on IAD being available.
- Fly.io accepted potentially stale reads in exchange for performance, using read replicas across regions while keeping a write master in IAD.
- The change brought p99 secret-read latency down to 300 milliseconds.
Access controls and migration
- Workers must present their credentials and a third-party macaroon discharge token authorizing access to a particular app’s secrets.
- A compromised worker is limited to secrets for apps deployed on that worker; denied reads are logged and trigger alerts.
- Fly.io began migration in March 2024 and completed the cutover for flyd secret reads in July 2025. Vault remains in use elsewhere in its infrastructure.
Fly KMS
- Fly KMS provides encrypt, decrypt, sign, and verify operations using secrets stored in Petsem, without exposing those secrets to the app.
Generated by AI from the original article. Check the source for full details.