Is my Lovable app leaking my users' data, and how do I check and fix it without being a developer?

By Ranjit Bhinge, founder of Blur Studio · Updated · 7 min read

Short answer: It might be, and you can find out in about ten minutes. Lovable is an AI tool that builds web apps from chat, and many of its apps keep data in Supabase, a hosted database. Supabase's documentation says a table without Row Level Security, or RLS, is readable and writable by any role with a grant on it. RLS is a set of rules inside the database that decide which rows each person may see. Test it by logging out, trying a second account, and asking the database directly with the public key. If anything comes back that should not, fix it now or pay a developer to.

Ranjit Bhinge

You built something in Lovable, real people have signed up, and you want to know today whether one customer can read another customer's information.

I'm Ranjit, and I run Blur Studio: 15+ years building software, 120 apps taken live, and clients who have gone on to raise $10M+. I build AI systems and processes that help businesses do a lot more with a lot less time. I also work differently from most of what else is out there, more on that further down this page. Say hello.

The short answer

Your app has two sides. The screens run in the visitor's browser. The data sits in a database. If the database has no rules, then anyone who can reach it can ask for the data directly, even if your screens never show it. Once login works, check the Lovable Google login redirect URL fix.

That is the exposure people are talking about. Supabase's own documentation says that a table in an exposed schema without RLS is readable and writable by any role with a grant on it. Lovable's documentation says misconfigured RLS rules are a common cause of data leaks, and that you are responsible for checking that your app meets the security needs of its use. This page is practical information, not legal advice.

Why an AI-built app can end up open

When an AI tool builds your app, its goal is a working screen. A screen that shows "my orders" works whether or not the database is locked. Nothing breaks in the demo, so the missing rule goes unnoticed.

The key in your app's code is not a secret, by design. Supabase calls it the publishable key, or the older anon key, and says anyone can read it because it only reaches what RLS allows. So the lock must be in the database. A second key, the secret key (formerly the service role key), skips RLS completely and must never appear in browser code. Supabase's documentation says to use it only on servers you control.

For more on the wider pattern, see why AI-built apps break and the AI-built app security checklist, which also covers a published 2025 Lovable flaw.

The ten-minute test anyone can run

Do these in order. You do not need to read code. Use a test account, not a real customer's.

Test 1: signed out

Open a private browser window. Do not log in. Go to the page that lists private things, such as orders, messages or profiles. If you see any of it, stop and fix now.

Test 2: two accounts

  1. Create two test accounts, A and B.
  2. As A, create an order, note or file.
  3. Log in as B in a different browser. Look for A's item in every list and search.
  4. If your app uses links with an ID in them, such as /orders/123, copy A's link and open it as B.

B should see nothing of A's. If B can see or change it, your rules are too loose.

Test 3: ask the database directly

This one catches what the screens hide. In your Supabase project, find the project address and the publishable (or anon) key under the API settings, in the Connect dialog. Then, from a computer terminal, ask for a table without logging in. Replace the bracketed parts with your own:

curl "https://[your-project].supabase.co/rest/v1/[table-name]?select=*" -H "apikey: [publishable-key]"

If you get back rows of real data, the table is open to the world. If you get an empty list or an error, that is the result you want. If you are not comfortable with a terminal, ask a developer friend to run this for you. It takes them two minutes. Repeat it for every table that holds anything private.

Test 4: look at the rules

Lovable's documentation says you can review every policy in your project under More, then Database, then Manage, then Policies. Look for tables with no policies at all, and for policies that say something like "true" for everyone. Lovable also has built-in Quick scan and Deep scan security checks. Its documentation says these help find common issues but do not replace a thorough review.

What a safe setup looks like

Take a typical table called orders. Each row has a user_id that says which customer it belongs to. The aim: a signed-in customer sees and changes only their own rows, and a signed-out visitor sees nothing.

Before: open

RLS is off, or a policy says everyone may do everything. Anyone with the public key can list every order.

After: locked to the owner

This follows the pattern in the Supabase documentation. Have a developer or the AI tool review it against your real table names before you run anything.

alter table orders enable row level security;
revoke all on table orders from anon, authenticated;
grant select, insert, update, delete on table orders to authenticated;

create policy "Users see their own orders"
on orders for select to authenticated
using ((select auth.uid()) = user_id);

create policy "Users create their own orders"
on orders for insert to authenticated
with check ((select auth.uid()) = user_id);

create policy "Users change their own orders"
on orders for update to authenticated
using ((select auth.uid()) = user_id)
with check ((select auth.uid()) = user_id);

In plain words: switch the lock on, take away what signed-out visitors can do, give signed-in users the basic actions, then add a rule that each person only touches rows where user_id is their own ID. The Supabase documentation notes that adding policies does not remove the default permissions, which is why the revoke line matters. It also says that once RLS is on, no data is reachable with the publishable key until you add policies, so test your screens after.

The error that tempts people to turn it off

After you switch RLS on, you may see: new row violates row-level security policy for table. This means a policy refused a write. Usually the row was saved without the right user_id, or no insert policy exists. It is the lock working, not a bug to remove.

The wrong fix, and the one an AI tool might suggest, is to turn RLS off or add a policy that lets everyone through. That puts you back at the start. The right fix is to make sure the app saves the signed-in user's ID with each new row and that an insert policy with a matching check exists.

Other places data leaks

  • A secret key in the browser code. It skips RLS entirely. If it was ever exposed, replace it. Supabase documents how to rotate a key.
  • Views and functions that return data from a locked table. Test these too.
  • File storage set to public when the files are private.
  • Admin checks done only on the screen. Hiding a button is not a permission.
  • Every table counts. One forgotten table is enough. The OWASP project, which publishes a widely used list of web security risks, ranks broken access control as its top category for 2021.

Do it yourself or pay someone

SituationMy call
Test app, no real users, fake dataFix it yourself with the AI tool and rerun the tests.
A few real users, ordinary contact detailsFix with the AI tool, then pay a developer for a short review of the rules.
Payments, health, children, legal or financial recordsHire a developer. Do not rely on the AI tool alone.
You found real data was exposedFix it now, then see below.

If you do hire, hiring a Lovable developer covers what to ask. For the full path from prototype to live, see moving an AI-built app to production and is a vibe-coded app production ready.

If you find real data was exposed

  1. Lock the tables first. Do not wait for a perfect fix.
  2. Rotate any key that might have been exposed.
  3. Write down what was exposed, for how long, and which users.
  4. Check your database logs, if you have them, for outside access.
  5. Ask a lawyer. Depending on where your users live and what the data was, you may have a duty to tell them or a regulator. That is a legal question, so ask a lawyer.

Where a human must check

An AI tool can write these rules and can also get them subtly wrong. A rule that looks right can let a user change their own user_id, or leave a second table open. Someone who reads the rules, and tries to break them, has to sign off before you trust real data to the app.

How I'd approach this

I would run the signed-out test and the database test today, before reading anything else. They take ten minutes and answer the question.

If anything is open, I would lock the table first and let the app break a little. A broken screen is better than a public customer list. Then I would repair the screens one at a time, making sure each new row carries the user's ID.

I would never fix the "violates row-level security" error by turning RLS off. And once the rules are in, I would have a second person try to break them with two accounts. If the app takes payments or holds private records, that second person should be a developer.

Blur Studio fixes and finishes start around $1,500, and a security review of your rules is the usual first step. The page linked below explains what a fix includes.

Questions people ask

How do I know if my Lovable app has exposed data?

Run three checks: view private pages signed out, try a second test account against the first account's data, and ask the database directly with the public key using the curl line above. Any real data coming back means it is exposed. The full list is in the AI-built app security checklist.

Is the Supabase anon or publishable key a secret?

No. Supabase's documentation says it is meant to ship in the browser because it can only reach what Row Level Security allows. The secret key, formerly the service role key, is the dangerous one, because it skips RLS and must stay on a server.

What does new row violates row-level security policy mean?

A policy refused a write. The usual cause is a missing insert policy, or a row saved without the signed-in user's ID. Fix the policy or the app, not by turning RLS off. The Supabase documentation on insert policies uses a with check rule for this.

Can Lovable's security scan fix this for me?

It helps find common issues, and Lovable offers a Quick scan and a Deep scan. Its own documentation says these tools do not replace a thorough security review and recommends a professional review for sensitive data. See hiring a Lovable developer.

How much does a developer charge to fix RLS?

For a small app with a few tables it is a small job. The size depends on the number of tables and how tangled the rules are, so ask for a quote based on a list of your tables. Ask for the hours behind it.

Do I have to tell my users if their data was exposed?

It depends on where they live and what the data was. That is a legal question, so ask a lawyer. Lock the data first, and keep notes on what was exposed and for how long.

More in this topic: Problem solving: AI-built and no-code apps (26 guides) →

Sources

Ready for the next step?

A 30 minute call. If you do not need me, I will tell you.

Ranjit Bhinge You talk to me, Ranjit. I reply within a few hours.

Not sure what you need? Tell me what is going on. I will point you the right way, even if it is not me.

Blur Studio · 30 minute call

Book a 30 minute call

You talk to me, Ranjit. If you do not need me, I will tell you.

  • We talk about your business and what is going on.
  • You leave with a clear next step, even if it is not me.
  • I reply to every message within a few hours.
Loading the calendar…