LeakLatch

Blog · November 16, 2026

Supabase's secret keys fail in the browser, but that won't save you

Supabase is deprecating the legacy anon and service_role keys by the end of 2026. The replacements are publishable keys (sb_publishable_...) for anything you ship, and secret keys (sb_secret_...) for servers and Edge Functions only.

One new guard: a secret key sent from a browser gets HTTP 401, because Supabase checks the User-Agent header. That stops an accidental frontend call, not a leak. Supabase's own docs say an attacker can still use a leaked key from other tools, and it bypasses every Row Level Security policy.

If your AI assistant hands you a long key starting with eyJ, that is the legacy format. Migrate, keep sb_secret_ out of client code and git, and rotate any key that has shipped.

Source: https://supabase.com/docs/guides/api/api-keys

Check whether a secret key is in your live bundle with a free, read-only scan at https://leaklatch.vercel.app