Lovable app security: six checks you can run today

Published 2026-11-29, updated 2026-11-30 by Nordik. Written with AI from the sources listed at the end.

The short version

The risk
Strangers can read or change your users' data when a database rule is missing or too open, or when a secret key ships in your app's public files.
Does it affect you?
Yes, if your Lovable app keeps user data in Supabase. Lovable Cloud runs on Supabase too.
What to do
Run Lovable's own security checks, then the six checks below. Each has a fix prompt to paste. About an hour in all.

Rather not read it all? Copy this for your AI tool. Paste it into the tool you build with. It asks the tool to check your app for the problems in this guide and explain what it finds in plain words. Nothing is changed.

See the prompt
Check my app for these six security problems and do not change anything yet. 1. A database table without Row Level Security. 2. A policy that uses "true" on a table holding user data. 3. The Supabase service_role or secret key in code that runs in the browser. 4. A private key in a VITE_ variable. 5. A page or query that lets one signed-in user read or change another user's records. 6. A view that reads user data without respecting Row Level Security. For each one, answer Pass, Fail or Could not check, name the table or file, and explain it in plain words.
Jump to a part (10)
  1. What Lovable already checks for you
  2. Check 1: Row Level Security is on for every table
  3. Check 2: no policy lets everyone in
  4. Check 3: the Supabase secret key is not in your app's public files
  5. Check 4: no other secret is in a VITE_ setting
  6. Check 5: one user cannot open another user's records
  7. Check 6: no view hands out what your rules hold back
  8. After every change, test again
  9. What these checks do not cover
  10. Get a second read

Lovable is a builder. How safe the app you built with it is depends mostly on two things you control:

  • the rules in your database that decide who may read and change each record
  • what your app hands to every visitor's browser

This guide covers the six checks that matter most for a Lovable app on Supabase. Each is done in a dashboard or a browser, with a prompt to paste into Lovable's chat to fix what you find.

What Lovable already checks for you

Lovable's documentation describes automatic checks that run before you publish. They look for:

  • a table without per-row rules
  • a rule that lets everyone in
  • leaked-password protection turned off
  • file storage rules
  • code libraries with critical known flaws

It also describes advanced checks that read your app's code across sign-in, access permissions, private data, keys and passwords, user input, app actions and payments. You find both under More, then Security, in the project toolbar.

The same documentation is direct about the limits. The checks find common problems but cannot guarantee your app is secure or replace a full security review, and you stay responsible for your app's security. It recommends a review by a security professional for apps that handle sensitive data.

So run Lovable's checks first, fix what they find, then do the six checks below.

Check 1: Row Level Security is on for every table

Supabase keeps your data in tables. Row Level Security, or RLS, is the database's own set of rules about who may read or change each row (one row is one record, such as one order).

Your app's public key is in every visitor's browser by design, so the rules are what stand between a stranger and your data. Supabase's documentation says to enable RLS on every table in an exposed schema, and that a table there without RLS is readable and writable by any role with a grant on it.

How to check:

  • Open your Supabase project, go to the Table Editor and look at each table. A table without RLS is marked as such.
  • Or open the SQL editor and run this read-only query. It lists every table in the public schema with true or false for RLS.

Query

select tablename, rowsecurity from pg_tables where schemaname = 'public' order by tablename;

Fix prompt for Lovable

Turn on Row Level Security for every table in the public schema that does not have it yet. For each table, add policies so that a signed-in user can only read, insert, update and delete their own rows (match on the column that holds the owner's user id, using auth.uid()). Do not add any policy that allows the anon role to read private data. List every table and policy you changed.

Check 2: no policy lets everyone in

RLS on is half the job. A policy is one rule, and a rule can be too open.

Supabase's documentation gives the example of a policy for the anon role (visitors who are not signed in) that uses the condition true. It grants every unauthenticated visitor read access to every row, and the documentation says to use it only for data meant to be public. The same condition on the authenticated role means any signed-in user can read every row. That is the classic way one customer sees another customer's data.

How to check:

  • In Supabase, open Authentication, then Policies, and read each policy in plain words.
  • For every policy, ask two questions: who does it apply to, and which rows does it let them reach?
  • A condition of true is fine for a table of public blog posts and a problem for a table of orders, messages or profiles.
  • A condition that compares the row's owner column to auth.uid() (the id of the user making the request) is the usual safe shape.

Fix prompt for Lovable

Review every Row Level Security policy in the database. Replace any policy that uses "true" on a table holding user data with a policy that only allows access when the row's owner column equals auth.uid(). Keep "true" only on tables that are meant to be public, and tell me which tables those are so I can confirm.

Check 3: the Supabase secret key is not in your app's public files

Supabase gives your project two kinds of keys:

  • The publishable key (the anon key on older projects) is made for browsers and is limited by RLS.
  • The secret key (the service_role key on older projects) goes around RLS and reaches everything.

Supabase's documentation says secret keys must never reach a browser. Supabase refuses a secret key sent from a browser, but an attacker can still use a copied key from other tools.

How to check:

  • Open your published app in Chrome and press F12 to open the developer tools.
  • Open the Sources tab and search all files (Ctrl+Shift+F, or Cmd+Option+F on a Mac).
  • Search for sb_secret_ and for service_role.
  • Older keys are long strings that start with eyJ, and both the anon and the service_role key look like that. So also copy the last ten characters of your service_role key from the Supabase dashboard and search for those.

If a secret key turns up, treat it as exposed.

Fix prompt for Lovable

Find every place the Supabase service_role or secret key is used in code that runs in the browser. Move each of those operations into a Supabase Edge Function that reads the key from a secret, checks that the caller is signed in and allowed to do the operation, and returns only what the page needs. The browser code must only ever use the publishable (anon) key. Show me the list of files you changed.

If the key was exposed, fixing the code is not enough. Supabase's guide on leaked keys says to fix the cause first, then create a new secret key, move your app to it and delete or deactivate the old one.

Check 4: no other secret is in a VITE_ setting

Lovable apps are built with a tool called Vite. Vite's documentation explains that settings whose names start with VITE_ are packed into the code every visitor downloads, and warns that they must not hold sensitive information. A payment, email or AI provider key saved as a VITE_ setting is public, even if no page shows it.

How to check:

  • In the same developer tools search, look for sk_live, sk_test and the words secret and Bearer.
  • In your project's settings, read the name of every setting that starts with VITE_ and ask whether a stranger may see it.

Fix prompt for Lovable

List every environment variable whose name starts with VITE_. For each one that holds a private key (payment, email, AI or any other private service), move that call into an Edge Function that gets the key from Lovable's stored secrets, and remove the VITE_ variable. Do not change the publishable Supabase key or the project URL.

Check 5: one user cannot open another user's records

Signing in answers who you are. It does not answer what you may see.

Broken access control, the top category in the OWASP Top 10 for 2025, is this gap: a signed-in person changes an id in an address or a request and reaches someone else's record. OWASP's advice is to deny by default.

How to check:

  • Create two test accounts.
  • Add a record in account A, such as an order or a note, and copy its address.
  • Sign in as account B in a private window and open that address.
  • Try the same with anything that has an id in it: invoices, files, settings pages.

If B sees A's data, you have found a real problem before a stranger did.

Fix prompt for Lovable

Make sure every page, query and Edge Function that reads or changes a record checks that the record belongs to the signed-in user, in the database policy or on the server, not only by hiding buttons on screen. Then add a short test plan I can follow with two accounts to confirm one account cannot see or change the other's records.

Check 6: no view hands out what your rules hold back

A view is a saved query that looks like a table. Builders sometimes add one to make a page load faster.

Supabase's documentation says views bypass RLS by default, because they are usually created by the database's owner role. So a view over a protected table can hand out every row its policies were meant to withhold.

How to check:

  • In the Supabase Table Editor, look for entries marked as views, or ask Lovable to list them.
  • For each view that reads a table holding user data, confirm it is meant to be public.

Fix prompt for Lovable

List every database view in the public schema and the tables it reads from. For any view that reads user data, either remove it or recreate it so it respects the Row Level Security policies of the tables underneath (security_invoker), and tell me which views you changed.

After every change, test again

A fix prompt changes your app, and a rule that is now tight may make a page go empty. That is the rule working.

  • Re-run the two-account test after every change.
  • Run Lovable's own security checks again before you publish.
  • Keep this routine for every release, because each new feature can add a table, a rule or a key.

What these checks do not cover

These six checks cover the leaks that most often show up in Lovable and Supabase apps, not every problem. They will not tell you whether a payment flow can be tricked, whether an uploaded file can be abused, or whether a library you depend on has a new flaw. They also depend on reading each rule correctly.

Get a second read

Want an outside check of your published app first? The free scan looks at your public pages for a Supabase secret key in your scripts, other secret keys, tables readable without signing in, sign-in settings and storage buckets. It cannot see your code or the rules for signed-in users.

The full audit goes deepest on apps built on Supabase. It reads your code and database rules, never runs them, and each finding comes with a prompt like the ones above, written for your app.

Sources

Each source below was accessed on the date shown. Documentation changes over time, so check the source for the current wording.

  • Lovable documentation, Security, accessed 2026-11-29
  • Supabase documentation, Row Level Security, accessed 2026-11-29
  • Supabase documentation, API keys, accessed 2026-11-29
  • Supabase documentation, Rotate leaked API keys, accessed 2026-11-29
  • Vite documentation, Env variables and modes, accessed 2026-11-16
  • OWASP Top 10:2025, A01 Broken Access Control, accessed 2026-11-30

See what your live app shows strangers

Paste the link to your app: in under a minute the free scan shows what your live app hands to any visitor, and where to look first. No sign-up, and it never signs in or changes anything.

Run a free scan

Want the code itself read? Order the $49 audit or see a sample report. Your card is held and charged only when your report is delivered. It is not a pentest: the audit is done by AI, and a second AI checks each serious finding.