Is a Supabase anon key in a Lovable or Bolt app a leak? How to tell the difference
Developers building apps with Lovable, Bolt, or v0 that use Supabase often find a long JWT string in their JavaScript bundle and assume it is a leaked credential. The article explains that the anon key is designed for browser use and is not secret on its own, and that decoding its role claim distinguishes it from the service_role key. A service_role key, which bypasses all access rules, is a genuine leak and should be rotated immediately and moved to a server function. The anon key remains safe only if Row Level Security is enabled and policies do not allow open access such as USING (true) on private tables. The author recommends checking dashboard policies and testing from a signed-out browser or with two accounts to confirm users cannot read each other's data.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in