Skip to main content
Security is foundational to Unkey. We handle API keys for your production systems, so we take this responsibility seriously.

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:
1

Key generation

We generate a cryptographically random key (e.g., sk_live_abc123xyz...)
2

Key returned to you (once)

The plaintext key is returned in the API response. This is the only time you’ll see it.
3

Hash stored

We compute a SHA-256 hash of the key and store only the hash in our database.
4

Verification

When a key is verified, we hash the provided key and compare it to the stored hash. Match = valid.
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.

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
Learn more about root keys →

Infrastructure security

Compliance & certifications

We have SOC 2 Type II certification which you can find in our trust center . If you have specific compliance requirements, contact us to discuss.

Responsible disclosure

Found a security issue? We appreciate responsible disclosure.
  • Email: security@unkey.com
  • 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

IP Whitelisting

Restrict key verification to specific IP ranges

Key Recovery

What to do if a key is compromised

GitHub Scanning

Automatic detection of leaked keys in public repos

Delete Protection

Prevent accidental deletion of critical keys
Last modified on July 20, 2026