Supabase has become one of the most popular backends for startups, and for good reason. You get a hosted Postgres database, authentication, file storage, realtime subscriptions and auto-generated APIs in an afternoon. AI coding tools love it too, because a single prompt can scaffold a working app with sign-up, a dashboard and a database in minutes.
That speed hides a dangerous detail. In a Supabase app, the browser talks to your database directly through the public API. The "anon" key that ships inside your frontend bundle is not a secret. Anyone can open developer tools, copy it, and send queries to your project. The only thing standing between that person and your users' records is Row Level Security (RLS) and the policies you write for it.
Recently, the developer community has been passing around audits of AI-generated ("vibe coded") apps that exposed passports, private chats and payment details simply because RLS was switched off or a policy was written as "allow everything". None of these apps were hacked in the movie sense. Someone just asked the API for data, and the API said yes.
This guide is a practical security checklist for founders and small teams shipping on Supabase. It is written for the moment right before launch, or right now if you are already live and have never audited your policies. If you want the deeper theory behind policy design for multi-tenant products, pair this with our build guide to Postgres Row-Level Security for multi-tenant SaaS.
Before you can audit anything, you need a clear mental model. There are three keys and one rule that matter.
Once you internalise this, every security question becomes simpler. You are not asking "is my app secure?" You are asking "for each table, for each operation, who does my policy allow?"
Consider an illustrative scenario that mirrors patterns we see when teams bring AI-generated MVPs to us for review. A two-person startup builds a customer feedback board with an AI coding assistant. Users sign up, post feature requests and leave private notes for the founder. The app works beautifully in demos.
Under the hood, the generator created a notes table, enabled RLS on it, and then added a single policy: select using (true). The intent was "let logged-in users read notes". The effect was "let anyone on the internet read every note from every customer". A separate profiles table never had RLS enabled at all, so email addresses and company names were also exposed. Storage buckets holding uploaded screenshots were marked public.
The fix took less than a day: enabling RLS everywhere, rewriting policies to compare user_id with auth.uid(), making buckets private with signed URLs, and moving one admin action into an edge function. The cost of not fixing it could have been the company. This is exactly why we treat a security pass as a required step in our production guardrails for vibe-coded products.
Work through these steps in order. Each one builds on the previous, and together they cover the mistakes we see most often when reviewing Supabase projects.
Open the SQL editor and list every table in the public schema along with its RLS status. Supabase's built-in Security Advisor will also flag tables with RLS disabled. Your target is simple: zero tables in exposed schemas with RLS turned off. If a table genuinely should be public (a list of countries, for example), enable RLS anyway and add an explicit read-only policy. Explicit is always safer than implicit.
Search your migrations and the policy list for using (true) and with check (true). These are the most common way AI tools "fix" a permission error. Every one of them needs a written justification. If you cannot explain in one sentence why anonymous visitors should read or write that table, the policy is wrong.
Separate policies for select, insert, update and delete make intent obvious. A typical pattern for user-owned data looks like this:
RLS works on rows. If a profiles table holds both a public display name and a private phone number, any user allowed to read the row can read both. Split sensitive fields into a separate table with stricter policies, or expose a database view that only contains safe columns. Also watch for columns like role, is_admin or plan that users should never be able to update themselves.
Storage has its own policies on the storage.objects table. Public buckets are fine for marketing images and avatars you are happy to share. Invoices, ID documents, medical files and private uploads belong in private buckets, served through short-lived signed URLs. Use a folder convention such as user_id/filename and write policies that check the first folder segment against auth.uid(). Validate file types and sizes on upload too, rather than trusting the browser.
Search your frontend code, mobile app, environment files committed to git and CI logs for the service role key. If you find it anywhere client-side, rotate it immediately. Any action that genuinely needs elevated rights (sending invites, processing payments, admin reports) should live in an edge function or your own backend, which validates the caller before using the service key.
Functions marked security definer run with the privileges of their owner and can bypass RLS. They are useful, but each one is a potential back door. Make sure every such function checks auth.uid() internally, sets a fixed search_path, and is not callable by the anon role unless intended. Revoke execute permissions from roles that do not need them.
Turn on email confirmation, set sensible password rules, configure redirect URL allowlists so attackers cannot hijack OAuth flows, and enable rate limits and CAPTCHA on sign-up and password reset. If your app serves businesses, consider multi-factor authentication for admin accounts.
Create two test users. Log in as user A, copy the JWT, and try to read, update and delete user B's records directly with curl or a REST client. Then repeat the same requests with only the anon key. Automate these checks with a small test suite that runs on every migration, so a future policy change cannot quietly reopen a hole.
Enable logging, watch for unusual query volumes from the anon role, and re-run the Security Advisor after every schema change. Security is not a launch-day checkbox. It is a habit that should live inside your release process.
A useful rule of thumb: if your app would be embarrassing to run with the anon key printed on your homepage, your policies are not finished yet. In a Supabase app, it effectively is printed there.
Many founders can complete this checklist themselves in a focused day or two. It is worth getting a second pair of eyes if your app handles payments, health information, identity documents or data belonging to other businesses, or if the codebase was generated quickly and nobody on the team fully understands the schema. A structured review usually pays for itself by preventing a single incident. Our web development team regularly audits and hardens Supabase and Postgres backends as part of taking MVPs to production.
That hardening work often feeds into broader SaaS development engagements once the product starts to scale.
Supabase is not insecure. It gives you powerful, fine-grained tools, and then trusts you to use them. The apps that leak data are the ones where RLS was disabled, where "using (true)" slipped through, or where the service role key ended up in the browser. Every one of those mistakes is easy to find and fast to fix once you know where to look.
Inventory your tables, rewrite permissive policies, lock down storage, keep privileged keys on the server, and test your API the way a curious stranger would. Do it before launch if you can, and today if you already have users. The speed of modern tooling is a genuine advantage, but only when the data underneath it stays where it belongs.