Key security principles
Keys are never stored in plaintext
We hash your API keys before storage. Even if our database were compromised, attackers couldn’t recover the original keys.
You control the lifecycle
Create, rotate, and revoke keys instantly. Changes propagate globally within seconds.
Minimal permissions by default
Root keys use explicit permissions. Grant only what’s needed for each use case.
Audit everything
Every key operation is logged. Know who did what, when, from where.
How API key storage works
When you create an API key through Unkey:Key returned to you (once)
The plaintext key is returned in the API response. This is the only time you’ll see it.
This is the same approach used by GitHub, Stripe, and other security-conscious platforms. Even with full database access, an attacker cannot recover your original keys.
Encryption at rest
For keys that require recovery (optional feature), we store encrypted versions in our secure vault:- Secrets are encrypted at rest using industry-standard encryption
- A leak of vault data does not expose secrets
- A leak of the main database does not expose secrets
- A leak of the main encryption keys does not expose secrets
Root keys
Root keys authenticate your requests to the Unkey API itself. They’re how you create, manage, and verify API keys programmatically. Best practices:- Use separate root keys for different environments (dev, staging, production)
- Grant minimal permissions — only what each service needs
- Rotate root keys periodically
- Never commit root keys to version control
Infrastructure security
| Layer | Protection |
|---|---|
| Transport | All API traffic uses TLS 1.3. No plaintext connections accepted. |
| Infrastructure | Requests are processed across our globally distributed infrastructure, with DDoS protection. |
| Database | Encrypted at rest and in transit. Regular backups with point-in-time recovery. |
| Access | Internal access requires multi-factor authentication and is logged. |
Compliance & certifications
We’re actively working toward SOC 2 Type II certification. If you have specific compliance requirements, contact us to discuss.Responsible disclosure
Found a security issue? We appreciate responsible disclosure.- Email: [email protected]
- Please include steps to reproduce
- We’ll acknowledge within 48 hours
More security features
Root Key Permissions
Fine-grained access control for your root keys
Key Recovery
Securely recover keys when needed
Delete Protection
Prevent accidental deletion of critical resources