SupabasemichelAnnouncement
Supabase Vault
Summary
Supabase Vault is a Postgres extension for managing secrets and encryption inside the database, presented as a thin usability layer over pgsodium. The announcement contrasts it with pgcrypto, which accepts raw encryption keys directly and lacks public key signing, key derivation APIs, and streaming encryption. Vault stores secrets in an encrypted text column, while a unique per-database root key is managed outside SQL by pgsodium and libsodium; rows expose an internally derived key ID rather than the raw key. The vault.decrypted_secrets view decrypts values on demand, leaving stored data encrypted on disk and in backups, and users can create additional keys with pgsodium.create_key(). Vault uses Authenticated Encryption with Associated Data, binding the associated column to the authentication signature, and is positioned for API keys, access tokens, and environment variables rather than larger PII datasets.
Context
The source identifies raw-key handling in pgcrypto as a problem because encryption keys must be passed directly to SQL functions and can leak through logs, files, clients, tables, or replication streams. It also states that databases need tools that keep sensitive data encrypted in storage and backups, while pgcrypto lacks several features described as important for security-first applications.
Approach / What changed
Vault provides an encrypted secrets table backed by pgsodium and libsodium. Supabase generates and preserves a unique per-database root key, managed outside SQL by the Postgres server, and uses internally derived key IDs for encryption. The vault.decrypted_secrets view decrypts values when queried, while the stored rows remain encrypted. Users can optionally create and select additional keys with pgsodium.create_key(), and associated data is authenticated with the ciphertext using Authenticated Encryption with Associated Data.
Takeaways
The raw encryption key is not exposed in SQL: vault.secrets stores an internally derived key_id, while pgsodium manages the root key through Server Key Management.
vault.decrypted_secrets decrypts values on the fly, so secrets remain encrypted on disk and in backups while still being available through the view.
Vault uses Authenticated Encryption with Associated Data, combining the associated column with the encrypted text’s authentication signature so that associated data can be verified as authentic.
Source and freshness
- Source
- supabase.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.