---
title: "Supabase Vault"
description: "Supabase Vault is a Postgres extension, built as a thin layer over pgsodium and libsodium, that stores secrets such as API keys and access tokens encrypted on disk and in backups."
url: "https://swe.quest/articles/supabase-vault-3db5f31fada1a63f"
canonical: "https://supabase.com/blog/supabase-vault"
source: "Supabase"
published: "2022-08-19"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["postgres","cryptography","security"]
---

# Supabase Vault

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2022-08-19, 5 min read, Announcement. Original: [https://supabase.com/blog/supabase-vault](https://supabase.com/blog/supabase-vault)

## Summary

Supabase Vault is a Postgres extension, built as a thin layer over pgsodium and libsodium, that stores secrets such as API keys and access tokens encrypted on disk and in backups. Unlike pgcrypto, which requires passing raw keys through SQL where they can leak into logs, replication streams and clients, Vault references keys by ID and derives them from a per-database root key held outside SQL by pgsodium's Server Key Management. Secrets go into the vault.secrets table and are decrypted on the fly through the vault.decrypted\_secrets view. Encryption uses AEAD, so the associated-data column is authenticated alongside the secret, and custom keys can be created with pgsodium.create\_key().

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Cryptography](https://swe.quest/tags/cryptography.md) (Security)
- [Security](https://swe.quest/tags/security.md) (Security)

## Prerequisites

- PostgreSQL extensions ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- symmetric encryption basics ([easy posts on Cryptography](https://swe.quest/tags/cryptography.md?difficulty=easy))

## Keywords

Supabase Vault, pgsodium, libsodium, pgcrypto, AEAD, Supabase

## Related posts

- [Supabase Vault is now in Beta](https://swe.quest/articles/supabase-vault-is-now-in-beta-56d546a7bcadd895.md): Supabase · 2022-12-16 · Medium · 6 min read · PostgreSQL, Cryptography, Security, Privacy
  Supabase Vault is a Postgres extension and dashboard UI for storing encrypted secrets and encrypting columns, built on pgsodium's Transparent Column Encryption.
- [Supabase Security Retro: 2025](https://swe.quest/articles/supabase-security-retro-2025-91f5c4e25d9fa3d9.md): Supabase · 2026-01-07 · Easy · 7 min read · PostgreSQL, Security, Identity & auth
  Supabase's 2025 security work centered on safer defaults around Postgres Row Level Security and API exposure.
- [Why we chose Turso to secure AI credentials](https://swe.quest/articles/why-we-chose-turso-to-secure-ai-credentials-d8af40123ec1f1e5.md): Turso · 2026-06-16 · Medium · 11 min read · SQLite, Rust, Cryptography, PostgreSQL, AI agents
  Eden, a gateway and control plane for database, API and AI traffic, uses Turso's in-process SQLite-compatible storage with AES-256-GCM whole-database encryption so a single Rust binary can run beside the workloads it governs without a separate Postgres.
- [Storage is now available in Supabase](https://swe.quest/articles/storage-is-now-available-in-supabase-a17d1a6604548758.md): Supabase · 2021-03-30 · Medium · 7 min read · Storage systems, PostgreSQL, Identity & auth, System design, TypeScript
  Supabase Storage is an object store built as a custom TypeScript/Fastify API server behind Kong, with object metadata and access policies kept in each project's Postgres database and objects stored in S3.
- [Introducing JWT Signing Keys](https://swe.quest/articles/introducing-jwt-signing-keys-979b097fede857fb.md): Supabase · 2025-07-14 · Medium · 5 min read · Identity & auth, Cryptography, PostgreSQL
  Supabase Auth now supports asymmetric JWT signing keys (RSA or elliptic curve), letting apps verify tokens locally using public keys published at a JWKS endpoint instead of calling the Auth server or sharing a forgeable secret.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
