Supabase Security Advisor warnings in an AI-built app: which to fix first

By Arif Khan, AIVolve LLC · Updated November 27, 2026

"Supabase's Security Advisor shows a pile of errors and warnings on my app. Which ones are real, and which can I ignore?"

Short answer: Supabase's Security Advisor runs fixed checks (called lints) against your database and labels each one ERROR, WARN or INFO. Fix the ERRORs first, because most of them mean someone with your project URL and public key could read or change data: a table without Row Level Security, a view that skips it, a table with password-like or token-like columns, a rule that trusts user_metadata. Then review the WARNs that matter most for AI-built apps: rules written as using (true), and SECURITY DEFINER functions that anyone can call. The rest (extensions in the public schema, tables with RLS on and no rules, performance hints) can wait until after launch. Two cautions: a clean Advisor does not prove your app is secure, because it cannot tell whether auth.uid() = user_id is the right rule for your data, and some findings are intentional, so check each one before you change it.

Where to run it

You can open the Security Advisor three ways, per Supabase's docs:

If your Lovable app uses Lovable's built-in backend (Lovable Cloud), you may not have a Supabase dashboard to open. Lovable runs its own checks, under More → Security. Its Database security check looks at RLS and related settings such as file storage rules and leaked-password protection. Lovable's Dependencies page lists vulnerable packages. Use the Supabase Security Advisor if your app is connected to your own Supabase project.

What each message means, and what to do

The "Message" column is the summary text Supabase's docs show for each lint. The number is the lint ID, which you can search for in Supabase's Advisors page.

Message (lint) Level and what it means What to do
Table publicly accessible (0013) ERROR. A table in the public schema has no Row Level Security, so anyone with your project URL can read, edit and delete its rows. Fix today. Turn on RLS, then add rules. See fix 1.
Sensitive data publicly accessible (0023) ERROR. A table with no RLS has columns named like password, token, api_key, ssn or card_number. Fix today, and rotate any real secret stored there. See fix 1.
View bypasses row-level security (0010) ERROR. A view in public runs with its creator's rights and ignores RLS. Fix today. Recreate it with security_invoker. See fix 4.
User data exposed through a view (0002) ERROR. A view reads auth.users, so it can hand every user's record to API callers. Fix today. Copy only the columns you need into your own profiles table. See fix 4.
Security policy relies on user-editable data (0015) ERROR. A rule reads user_metadata, which signed-in users can change themselves. Fix today. Never base a rule on user_metadata. See fix 4.
Security policy allows unrestricted access (0024) WARN. A rule says using (true) or with check (true), so RLS is on but lets everyone through. Review this week. See fix 2.
SECURITY DEFINER function is callable without signing in (0028) or by signed-in users (0029) WARN. The function runs with its owner's rights, and your public key can call it at /rest/v1/rpc/<name>. Review this week. See fix 3.
Function callable and runs a SQL string passed in by the caller (0031, 0032) ERROR or WARN. A helper such as exec_sql(query text) lets a caller run SQL. Fix today. Revoke or drop it. See fix 3.
Detects public storage buckets whose broad SELECT policies make their contents listable (0025) WARN. Anyone can list every file in a public bucket. Review this week. See fix 5.
Unsecured function search path (0011) WARN. A function does not pin search_path. Schedule. See fix 6.
Extension installed in public schema (0014) WARN. An extension's internals show up in your API. Schedule. One alter extension line.
No access rules defined (0008) INFO. RLS is on but there are no rules, so the API returns nothing. Safe for a table the app should never touch directly. Otherwise add a rule.
Security policy not enforced (0007) INFO. Rules exist but RLS is off, so they do nothing. Turn on RLS. See fix 1.
Anonymous sign-ins enabled (0012) INFO. People can get a signed-in session without an account. Fine if you meant it. If not, turn it off in Auth settings.

Supabase also lists performance and housekeeping lints (unindexed foreign keys, unused indexes, table bloat). They are not security problems. Ignore them until your app has real traffic.

Fix 1: Table publicly accessible, or sensitive data publicly accessible

Supabase's explanation: tables in the public schema are reachable over the API, and if RLS is off on one of them, anyone with your project URL can create, read, update and delete rows. The fix is one line per table:

alter table public.your_table enable row level security;

Warning: right after you turn RLS on, your app loses access to that table until you add rules, because the API then returns nothing. Add the rule in the same sitting. For a table where each row belongs to one user:

create policy "users read own rows"
on public.your_table
for select
to authenticated
using ((select auth.uid()) = user_id);

Add matching insert, update and delete rules only for the actions your app really needs. Our RLS check guide shows how to test with two real accounts, and the columns guide covers fields like is_admin that a user must never change. If the finding was 0023 and the columns hold real passwords, tokens or API keys, assume they were readable, rotate them, and stop storing secrets in a table the browser can reach. Rotation order is in our leaked-keys guide.

Fix 2: Security policy allows unrestricted access ("RLS policy always true")

This is the one founders search for most. Supabase says it fires when a rule uses using (true), with check (true) or a similar always-true test such as 1=1, and notes that the rule applies to every row for the roles it names. Common causes, in Supabase's words: placeholder rules created during development, and copy-paste from examples.

Replace the rule with one that checks who owns the row:

drop policy "allow_all" on public.posts;

create policy "users read own posts"
on public.posts
for select
to authenticated
using ((select auth.uid()) = user_id);

When using (true) is correct: a table that everyone is meant to read, such as published blog posts or a product list. Supabase lists public read-only tables as an expected false positive. Make sure the rule is for select only. A true rule on insert, update or delete lets everyone write.

One option in Supabase's docs deserves care for AI-built apps: disabling RLS to make the warning disappear. For a table with private data, that trades a WARN for the ERROR in fix 1. Only do it for a table that is truly public, and then check what the app writes to it.

Fix 3: SECURITY DEFINER functions anyone can call

Supabase's explanation: a SECURITY DEFINER function runs with its owner's privileges, not the caller's, and that owner can normally read every row. Postgres gives new functions EXECUTE to everyone by default, and Supabase also grants it to anon and authenticated, so a helper function you wrote for your own code can be called by anyone holding your public key at /rest/v1/rpc/<function name>. The function does not have to appear in your app for that to work. AI assistants often write these, for example a has_role helper used in admin rules, or a function that runs with elevated rights "so it works".

First list yours:

select p.proname,
       pg_get_function_identity_arguments(p.oid) as args,
       pg_catalog.pg_get_userbyid(p.proowner) as owner
from pg_catalog.pg_proc p
join pg_catalog.pg_namespace n on n.oid = p.pronamespace
where n.nspname = 'public'
  and p.prosecdef
order by p.proname;

For each function, decide which of three cases it is, using Supabase's three options:

  1. Nobody outside your own code should call it. Revoke access from everyone who does not need it. Do anon, authenticated and public together, because revoking only anon usually leaves it open to every signed-up user:
    revoke execute on function public.my_helper(int, text) from anon, authenticated, public;
    
  2. It does not need elevated rights. Make it run as the caller, so RLS applies:
    alter function public.my_helper(int, text) security invoker;
    
  3. It is meant to be public, such as a contact-form function that writes to a table visitors cannot write to directly. Keep it, and make sure it checks its inputs and does only that one job. Treat it as a public API endpoint.

Supabase's Row Level Security guide adds a safer home for helper functions that rules depend on: put them in a schema that is not listed under "Exposed schemas" in your API settings, and give them set search_path = '' with every name written with its schema.

Test after each change. PostgreSQL's documentation says rule expressions run with the privileges of the person making the request, so a rule that calls a function you just locked down can start failing for your users. After changing a function, sign in as a normal test user and open the pages that use it.

If lint 0031 or 0032 names a function like exec_sql(query text), treat it as urgent. Supabase says anyone who can call it can run SQL through it, and that checking the string starts with select does not make it safe. Revoke it from anon, authenticated and public, or drop it:

revoke execute on function public.exec_sql(text) from anon, authenticated, public;

Fix 4: views, auth.users and user_metadata

Fix 5: a public bucket that lists every file (0025)

Supabase says files in a public bucket can already be fetched by URL, so a broad select rule on storage.objects is not needed for that, and it additionally lets anyone list everything in the bucket. If you do not need listing, remove the rule. The object URLs keep working:

drop policy if exists "Public bucket listing" on storage.objects;

Use the real name of your rule, which you can see under Storage policies. If the bucket holds private files, make it private instead.

Fix 6: unsecured function search path (0011)

Supabase recommends pinning each function's search_path to an empty string so a caller cannot redirect your function to look at objects they control:

alter function public.my_helper(int, text) set search_path = '';

After this, every table and function name inside the body must include its schema, for example public.profiles, or the function will stop finding them. Change one function at a time and test the screen that uses it.

A prompt for Lovable, Cursor or Claude Code

Run the Supabase Security Advisor checks for this project (or read the findings I paste below). Do not change anything yet. 1. List every ERROR and WARN finding with its lint ID, the table, view or function it names, and the role (anon or authenticated) that is affected. 2. For each finding, tell me whether the app code actually needs that access. Show the file and line that uses the table or function. 3. For each function flagged as SECURITY DEFINER, show who owns it, whether any Row Level Security policy calls it, and which of these fits: revoke access, switch to SECURITY INVOKER, move to a schema that is not exposed, or keep because it is meant to be public. 4. Propose the smallest SQL change for each finding, in order of risk, and say what could break. Never print a key or secret value. Wait for my approval before running anything.

How to check you are done

  1. Re-run the Security Advisor. Every ERROR should be gone, and every remaining WARN should be one you can explain in a sentence.
  2. Sign in as a normal test user and use the pages that read and write the tables and functions you changed. Then do the same as a second test user and confirm you cannot see the first user's rows.
  3. Open one of your table URLs in a private window without signing in. You should get no rows. This is the same check our RLS guide walks through.
  4. Keep a note of each finding you chose to accept and why, so the next review does not start from zero.

FAQ

What does "RLS policy always true" mean in Supabase?+

It means a Row Level Security rule uses a condition that is always true, such as using (true), so every row passes for the roles named. Supabase's Security Advisor reports it as "Security policy allows unrestricted access". Replace it with a rule that compares the row owner to the signed-in user, unless the table is meant to be public.

Is a clean Supabase Security Advisor enough to know my app is secure?+

No. The Advisor runs fixed checks, so it can tell that a table has no Row Level Security, but it cannot tell whether your rules match your product. A rule such as auth.uid() = user_id can pass every check and still be wrong for your data. Test with two real accounts and review any function that uses elevated rights.

Which Supabase Security Advisor warnings should I fix before launch?+

Fix every ERROR first: tables without RLS, tables with sensitive column names, views that skip RLS, views of auth.users, and rules based on user_metadata. Then review rules that are always true and SECURITY DEFINER functions that anon or signed-in users can call. Extensions in the public schema and performance hints can wait.

Should I revoke EXECUTE on every function for the anon role?+

Not blindly. Supabase says to decide per function whether anon should call it. Revoke access from anon, authenticated and public for helpers only your own code needs, switch to SECURITY INVOKER where elevated rights are not needed, and keep intentional public functions. Then test, because a rule that calls a locked-down function can start failing.

Can I turn off RLS to make a Supabase warning go away?+

Only for a table that is truly meant to be public. Turning RLS off on a table with private data replaces a warning with the more serious "Table publicly accessible" error, because anyone with your project URL can then read and change it. Fix the rule instead.

Want a second pair of eyes?

The Advisor only checks what it can see in your database. Our free X-ray takes about 2 minutes and needs no code or passwords. You get a plain-English verdict, and an AIVolve developer reviews every one within 1 business day. Get a free X-ray →

Related: Is my Lovable app secure? The 15-minute check before real users · Supabase RLS for AI-built apps: the 10-minute check · Supabase view bypasses RLS: security_invoker and revoking anon delete · Supabase anon key vs service_role key · Lovable security findings before you publish: what to do

Written by Arif Khan, AIVolve LLC. VibeCoderSOS isn't affiliated with Supabase, Lovable or Bolt. Based on Supabase's Advisors and Row Level Security documentation, PostgreSQL's documentation and Lovable's documentation, checked on November 25, 2026. We checked the SQL syntax but did not run it against a live Supabase project, and your project's settings may differ. Test every change on a copy first.

Need help?

Not sure which Advisor findings are real for your app? A free X-ray tells you what works, what only looks done and what to fix first.

Get a free X-ray →