The single most common security hole in AI-built apps is a Supabase table without row-level security. Here's what RLS is, how to tell if you're exposed, and the prompts to fix it.
If you built your app with an AI builder, there's a good chance it uses Supabase for its database. Supabase is excellent, but it has one setting that decides whether your users' data is private or public to the whole internet: row-level security (RLS).
Your app talks to Supabase using a public key. It's called public because it ships to every visitor's browser, so treat it as known to everyone.
That's safe only if the database itself enforces who can see what. That's RLS: rules attached to each table, such as "a user can only read rows where user_id matches their own ID".
Supabase's own Security Advisor (under Advisors) also flags tables without RLS.
Paste this into your AI builder:
For every table in my Supabase database:
1. Enable row-level security.
2. Add policies so signed-in users can only select, insert, update and delete
their own rows (matching auth.uid() to the table's user_id column).
3. For tables that should be public (like a product catalog), add a read-only
policy for everyone and no write access.
Show me the SQL and explain each policy in plain English before applying it.
Using the service-role key in the browser. The service-role key ignores RLS entirely. It belongs only in server code: API routes, edge functions, background jobs. Never in a component that runs in the browser, and never in a NEXT_PUBLIC_ variable.
"Fixing" errors by turning RLS off. When a policy blocks something, AI builders sometimes suggest disabling RLS to make the error go away. Don't. Ask for a policy that allows exactly the access you need.
Forgetting new tables. RLS is per table. Every table your builder adds later needs it too. Make "enable RLS and add policies" part of every prompt that creates a table.
RLS is one of the checks SafeLaunch runs on your code, alongside leaked keys, master keys in browser code, vulnerable packages and hidden malicious code. Each finding comes with the exact prompt to fix it.


Learn the most modern AI skills to
become the smartest person in the room.