GuardCue

Guide · Supabase

Is the Supabase anon key safe to expose? The plain answer.

Yes. The anon key is meant to be public: Supabase built it to sit in your website, where every visitor’s browser can see it. But it is only safe if every table has row level security switched on with the right rules. Without them, that same public key lets any stranger read your data. The key is never the problem; the rules behind it are.

What is the Supabase anon key?

It is the key your app uses to talk to your Supabase database from the browser. Supabase now calls it the publishable key (it starts with sb_publishable_), and says the old name, anon, is being retired by the end of 2026. Either way it works the same, and Supabase’s own guide calls it “safe to expose online”.

Why is a public key safe at all?

Because the key does not decide what anyone can see. The rules on each table do. In Supabase’s words, anyone can read the key, “so it only reaches what Row Level Security allows”. Think of the key as the front door of a building anyone may walk into, and the table rules as the locks on each room.

That is also why it is not safe on its own. A table with row level security switched off has no lock: anyone holding the public key can read it, and often change it. Supabase warns about exactly this as “RLS disabled in public”. A table with the switch on but no rule at all is the opposite: locked to everyone, your app shows nothing.

The key that must never be public

Your project has a second kind of key: the service role key, now called a secret key (it starts with sb_secret_). It ignores every table rule. If it is in your website, anyone can copy it and read, change or delete everything. If you find it there, replace it in Supabase straight away, then move it to your server. What to do when a key is exposed.

Where to find your Supabase anon key

  1. Open your project in the Supabase dashboard.
  2. Go to Settings, then API Keys.
  3. Copy the publishable key from the Publishable and secret API keys tab. On an older project, the anon key is on the tab for the legacy keys.

This key is meant to be in your app. The real danger is a table with no row level security, or the secret (service role) key placed in your website. The secret key stays on your server. Check your app free to see which one you have.

How do I check my app is safe?

Paste this into Claude, Lovable, Bolt, Cursor or whichever tool built your app:

Check how my app uses Supabase keys. The browser may only use the anon or publishable key. Make sure the service role key and any secret key are used only on the server and never appear in code that reaches the browser. Then make sure every table has row level security turned on, with a policy that lets signed in users read and change only their own rows. List every table and the policy it has.

Then check from the outside, the way a stranger would. Our free database check finds your app’s public key the same way a visitor’s browser does and shows which tables it can read, so you can see that the product list is open and the customer list is not.

GuardCue checks apps built with AI tools and explains what it finds in plain English, for the person who built it rather than for a developer. Check your database, free.