Common question

Is My Supabase Anon Key Safe to Show in My App?

Short answer: yes, the anon key is meant to be public. But only if your database rules are switched on. And the other Supabase key, the secret one, must never be in your app.

If you built your app with Lovable, Bolt or another AI tool, it may use Supabase for its database. So it's worth knowing which key is which.

Check your live app for free

Paste your link. The free summary usually takes under a minute.

Supabase has two kinds of keys

Supabase gives every project a public key and a secret key. Supabase is renaming them, so you may see either name:

Old nameNew nameLooks likeSafe in your app?
anonPublishable keysb_publishable_... (old one is a long string starting eyJ)Yes
service_roleSecret keysb_secret_... (old one is a long string starting eyJ)Never

The Supabase docs say the publishable key is "Safe to expose online," including in a web page. They say secret keys "provide full access to your project's data, bypassing Row Level Security" (Supabase API keys docs).

Supabase also says it is phasing out the old anon and service_role keys by the end of 2026, in favour of the new publishable and secret keys (same page).

Why the public key is OK

Anyone can open your site, press F12 and find your anon key. That's expected. Supabase says the key "only reaches what Row Level Security allows" (Supabase API keys docs).

Row Level Security (RLS) is a set of rules inside your database. It decides who can read or change each row. For example: "people can only see their own notes."

So the real question is not "is my key hidden?" It's "are my RLS rules on?"

The catch: RLS must be switched on

Supabase's own warning is clear. A table without RLS "is readable and writable by any role with a grant on it" (Supabase Row Level Security docs).

In plain words: if RLS is off, someone with your public key may be able to read or change that table. And your public key is, well, public.

Supabase also says that once RLS is on, no data can be reached with the publishable key until you add rules (policies) that allow it (same page).

The big danger: the secret key in your front end

The service_role or sb_secret_ key skips every RLS rule. Supabase says never to put one "in a browser, a shipped application, or source control" (Supabase API keys docs).

This can happen by accident. For example, an AI tool might paste the secret key into front-end code to "fix" a permission error. The error goes away, but now anyone can use that key.

If your secret key has been in public code, Supabase says to make a new secret key, swap it in everywhere, and then remove the old one (same page).

How to check your own app

  1. Find which key your site uses. Open your live site, press F12, and search the JavaScript files for sb_secret_, sb_publishable_ or eyJ.
  2. If you see sb_secret_ or a service_role key, act now. Move that code to a server or Edge Function, and make a new secret key.
  3. Open your Supabase dashboard and check RLS. Make sure it is on for every table your app uses.
  4. Check your rules make sense. A rule that lets anyone read everything is only OK for data that is truly meant to be public.

Run a free scan

Paste your live app's URL into the box at the top of this page. rooGBotVC reads your site's public JavaScript the same way a visitor's browser does. It flags a Supabase service_role or sb_secret_ key if it finds one. If it only finds the public key, it reminds you to check your RLS.

To be clear about the limits: the scan can't see inside your database, so it can't tell you whether your RLS rules are on. That part you check in your Supabase dashboard.

The free summary shows what was found. The full report (£9) adds a plain-English explanation and a fix prompt you can paste into your AI builder.

Quick answers

Is the Supabase anon key a secret?
No. It's meant to be in your app. Your RLS rules are what protect your data.

Is the service_role key safe in my app?
No. It skips all RLS rules. Keep it on a server only.

I built my app with Lovable. Do I need to worry?
Check two things: no secret key in your public code, and RLS switched on for every table. See our Lovable guide and our guide to the Supabase service_role key.

rooGBotVC is not affiliated with Supabase or Lovable. The scan is an automated, surface-level check, not a full security audit.