Get your AI-built app's access rules testedTest yours

Sample audit report

Sample vibe-coded app security audit report: one finding, fail to closed

One run of our own test app, an invoicing app with made-up users and data, built from one written request on Lovable's built-in back end and again on a Supabase project. Not a client. Nothing was planted; two apps give no rate.

The report: access table, ranked findings and what must change

The report a buyer receives, its database-rules part, filled from one run of our own test app with made-up data.

  • Our own test app, not a client. No client system, code or data appears here. Nothing was planted: both apps are as their builders made them from one request. Two apps, one run each, so no rate follows from them.
  • A sample, not a certification. It shows the report and the method on one small app.
  • Lovable and Supabase are their makers' products; we are not affiliated with them. Their names describe what was tested.
  • Executive summary, with the clearing decision left to the owner

  • The access table signed as owner, with each cell's result

  • Results by run, with cells not decided counted apart

  • Ranked findings in plain words, each weakness with its CWE

  • How a cell is judged: rows returned and rows changed

Sample audit report: Ledgerly, our test app

Source: One run of our own test app with made-up users and records; not a client, not planted, no rate. Every figure comes from our run records, which stay private.

Executive summary

What was tested. Ledgerly, a small invoicing app (clients, invoices, sharing invoices with a teammate, an admin page), built twice from the same written request: once on Lovable's built-in back end, and once on a Supabase project of our own, where an AI coding assistant wrote the app. Each app's database rules were exported with one read-only query and rebuilt as a copy with made-up users and records. Every cell of the access table below was tried on each copy.

What was found. On both apps, a teammate who had been shared invoices could also read the owner's whole client list, with names and email addresses, where the table says no access. It ranks first on both and is carried through this report. On the Lovable app, anyone holding a user's id could also learn whether that user is an admin; on the Supabase app, the admin could read every user's email.

What to fix first. The client read rule. After the fix and a re-test on a copy rebuilt from a fresh export, the teammate's read is closed on both apps, and on the Supabase app the same fix closed the admin's read of the client list. The other findings stay open in this sample.

The decision stays with the owner. This report states what was tested, how, and what was not. Whether that clears the app for its users or customers is the owner's decision, not ours.

Access table, signed as owner

Drafted by us from the app's build request and signed by us as the app's owner, before any test. Where the request was silent, the owner set the cell, marked *owner decision*. The Supabase run used the same table cell for cell; only names changed, because that app keeps each user's role in the profile row.

Roles: Anonymous (signed out); User A (owns the records tested); User B (signed in, nothing shared); Teammate T (User A shared invoices with T); Admin (admin role). Each row names who may; every other role has no access.

Data and accessWho mayFailed cells (L: Lovable run, S: Supabase run)
Invoices, readUser A, Teammate T, AdminNone
Invoices, create as A, change, deleteUser A (Admin: no access, owner decision)None
Clients, readUser A (Teammate T and Admin: no access, owner decision)L: Teammate T. S: Teammate T, Admin
Clients, create as A, changeUser ANone
Clients, deleteUser AS: User A, refused
Invoice shares, create a share of A's invoicesUser ANone
Invoice shares, read A's sharesUser A; Teammate T, its own share row (owner decision); Admin: no access, owner decisionNone
Roles, give oneself the admin roleNobody (Admin: not applicable)None
Roles, read other users' rolesAdmin (owner decision); User A: no access, owner decisionL: Anonymous, User A, User B, Teammate T; Admin, refused
Profiles, read A's profile with emailUser A (User B, Teammate T and Admin: no access, owner decision)S: Admin

"Refused" marks an allowed cell that did not work. Function calls the app exposes were tried under the cell they serve: 13 on the Lovable app, 4 on the Supabase app.

Results by run
CellsLovable built-in back endSupabase project
Tried: signed cells plus function calls77 (64 plus 13)68 (64 plus 4)
Pass5962
Fail64
Not decided122
Ranked findings64

A cell is not decided when an allowed cell in the same role's row failed: a refusal for that role means nothing until its allowed access is shown to work.

Ranked findings, plain words

Ranked by who could reach whose data first, then other access the table does not allow, then allowed access that does not work; within each, table order. Each security finding carries its CWE; allowed access that does not work, and a conflict the owner decides, carry none.

Lovable built-in back end

  • Rank 1. Teammate T could see all of User A's clients. 2 rows returned, client names and email addresses. CWE-863, Incorrect Authorization. Carried through below.
  • Ranks 2 to 5. Anyone holding a user's id could learn whether that user is an admin. Signed out, and as User A, User B and Teammate T, a role-check function the app exposes answered "true" about Admin. It runs with its creator's rights and anyone may call it. CWE-862, Missing Authorization. What must change: only Admin may learn another user's role, as the table says. Not fixed in this sample.
  • Rank 6. Admin could not list other users' roles through the roles table. 0 of 1 rows: allowed access that does not work, so no CWE. Until it passes, Admin's 12 no-access cells are not decided.

Supabase project

  • Rank 1. Teammate T reached User A's client list too. 2 rows returned. CWE-863. The rule is written differently from the Lovable app's and widens the same read.
  • Rank 2. Admin could read User A's client list. 2 rows returned. CWE-863. Closed by the same fix.
  • Rank 3. Admin could read User A's email. 1 row returned. CWE-863. The table gives Admin each user's role but not the email, and both sit in one profile row, so a row rule cannot give one and withhold the other. What must change: the role and the email apart (a column grant, a separate table or a function), or a new owner decision, since the app's admin page lists every user's email. Not fixed in this sample.
  • Rank 4. User A could not delete a client that still has invoices. HTTP 409, 0 of 2 rows changed. A link from invoices to clients with no delete action blocks it for everyone; a client with no invoices deleted fine. Not a security weakness: the owner decides. Until it passes, User A's 2 no-access cells are not decided.
How a cell is judged

Allowed cells run first. A no-access cell passes only when rows returned is 0 and rows changed is 0, counted on the database before and after each write. The HTTP status is recorded and never decides. Every cell starts from the same seeded rows.

One pair from the Supabase run shows why:

CellExpectedAnswerResult
Invoices, read, Teammate T: T asks for User A's two invoicesAllowedHTTP 200; 2 of 2 rows returned; 0 changedPass
Invoices, change, Teammate T: T tries to change the amount on User A's two invoicesNo accessHTTP 204, a success code; 0 rows returned; 0 changedPass

The database answered the forbidden change with success and changed nothing, so the cell is judged on rows changed, not on the status.

Read more

Every cell result here was tried on a copy built from exported rules.

Finding 1, carried from fail to closed

The teammate's read of User A's client list, cell by cell: the rule behind it, the fix on each stack, the re-test and the way back.

  • Lovable writes its own SQL from a chat request. On that route the export taken after the change, not the text we tried, is what the re-test runs on.
  • The fix and its undo ran on our own test apps, each confirmed by a fresh export of the rules. Both apps are back on their original rules.
  • The failed cell, and the allow cell that makes it count

  • The line in the exported rules that caused it

  • What must change, in words a builder's chat can take

  • The fix route on each stack, rules record first

  • The re-test on a copy rebuilt from a fresh export

  • The closure mark, and why it is that mark

  • The way back, written and tried before the change

Finding 1, both runs

Source: Lovable run first, the Supabase run beside it; made-up users and records, nothing planted.

In plain words

Teammate T could read User A's clients, names and email addresses. User A shared invoices with T. The app also let T read A's whole client list, which the table A signed says T may not see. Rank 1 of 6 on the Lovable app, 1 of 4 on the Supabase app.

Allow cell, passed first

Invoices, read, Teammate T. Expected: allowed. T asks for User A's two invoices: HTTP 200, 2 of 2 rows returned. Pass, on both runs. Without this pass, the deny cell below would say nothing.

Deny cell, failed

Clients, read, Teammate T. Expected: no access (owner decision). T, signed in, asks for User A's two clients: HTTP 200, rows returned 2, rows changed 0. Fail, on both runs.

The request, on the copy: GET <copy>/clients?select=*&id=in.(A's two clients) with Teammate T's token.

The line that caused it

Lovable app: the read rule on clients, clients read, for signed-in users, with this condition in the exported rules:

(auth.uid() = user_id)
OR is_teammate_of(user_id)
OR has_role(auth.uid(), 'admin'::app_role)

The is_teammate_of(user_id) term is true when the client's owner shared invoices with the caller, so the invoice share reaches the whole client table. The admin term gives Admin the same reach.

Supabase app: the read rule adds EXISTS (SELECT 1 FROM invoice_shares ...) and (SELECT is_admin()) to the owner check. The app's setup file says why: teammates and admins can read clients "so they can see the client name on an invoice".

What must change

The client read rule lets a user read only their own clients. Teammates and Admin keep reading the invoices they read today, and no other rule changes. Written so the owner can hand it to the builder's chat or a contractor.

What users will notice. Invoices store only the client's id, so after the fix a teammate's and an admin's invoice lists lose the client's name. On the Supabase app it shows as the app's placeholder. On the Lovable app, depending on how a screen asks, the name shows blank or the invoice drops out of the list; that app's screen code was not read. If teammates should see the name, that is a new decision in the table, not part of this fix.

Fix route: Lovable's chat
  1. 1. The owner saves the rules record: the part of the export this fix touches, the four client rules. It holds no rows.
  2. 2. Lovable's Modify database permission defaults to Always allow. In our run it was set to Ask each time first, so Lovable asks for approval before it changes the database.
  3. 3. Our written request goes into the project chat: change only the client read rule, what must not change, and "show me the SQL you will run" before applying it.
  4. 4. Lovable showed an approval card, "Apply database migration?", with its own SQL:

SQL

DROP POLICY "clients read" ON public.clients;
CREATE POLICY "clients read" ON public.clients
  FOR SELECT TO authenticated USING (auth.uid() = user_id);
  1. 5. Approved with "Allow migration". Lovable recorded the change as a migration file.
  2. 6. The rules query, run again straight after, shows exactly one difference from before: the client read condition, now (auth.uid() = user_id).

The rule we had tried on a copy was one ALTER POLICY statement. Lovable's statements differ and the resulting rule is the same: a copy built from the after-change export gives the same result as our tried rule in all 77 cells.

Fix route: Supabase SQL editor
  1. 1. The owner saves the rules record first, as on Lovable.
  2. 2. Our tried SQL goes into the SQL editor and runs as written; the editor answered "Success. No rows returned".

SQL

ALTER POLICY "clients: read own, shared, or as admin"
  ON public.clients
  USING (owner_id = (SELECT auth.uid()));
  1. 3. The rules query, run again straight after, shows exactly one change: the read condition. On this route the text tried on the copy is the text applied.
  2. 4. The same text belongs in the app's migrations folder too: the first setup file still holds the old rule, and a project set up again from it alone gets the old rule back.

The rule's name no longer describes it; renaming changes no access and is left to the owner.

Re-test on a fresh copy

After each change the owner ran the rules query again. A new copy was built from that export alone, not from our tried SQL or Lovable's card, and the whole table ran again, allowed cells first.

Cell or countLovable built-in back endSupabase project
Deny cell: Teammate T reads User A's clients2 rows before, 0 after. Pass2 rows before, 0 after. Pass
Allow cell: Teammate T reads User A's invoices2 of 2, before and after2 of 2, before and after
Cells changed2 of 772 of 68
Totals after the fix60 pass, 5 fail, 12 not decided64 pass, 2 fail, 2 not decided

The second changed cell is Admin's read of User A's client list, 2 rows to 0, on both runs. On the Supabase app it now passes; on the Lovable app it stays not decided, because Admin's allowed role read still fails for another reason. Every other cell, every allowed cell included, matched the first run.

Closure mark earned
Teammate T could read User A's client list. Closed. Rows returned: 2 before, 0 after. On a copy rebuilt from the rules you exported.

In a client report this line also carries the export's date. The mark is on a copy from your export: the owner ran the export, and the tests ran on a copy rebuilt from it. It is not seen by us, because nothing on the live app was read to decide it, and not confirmed by you, because it rests on the export and the tests, not on the owner's word. In this run we also played the owner, so the mark follows the method, not who was at the keyboard.

On the Supabase app the same fix earned the same mark for Admin's read of the client list.

The way back

Written, and tried on a copy, before anything live changed. On the copy, the reverse SQL matched the rules record exactly, and the whole table gave the first run's results again: 0 of 77 and 0 of 68 cells different.

  • Lovable: a written reverse request in the chat; the approval card showed Lovable's own SQL again. The export after the undo matched the original rules in every policy, table, function, view, type and role.
  • Supabase: the reverse SQL in the editor, as tried. The export after the undo matched the original in every section; only the export time differed.

Reversing a rule does not undo rows read or changed while the fix was live, and does not restore a screen changed alongside it. An undo that needs a dropped column was not part of this run. Lovable's Execute backward incompatible database migrations permission defaults to Never allow.

Coverage, what was not tested, and notes beyond the table

How the run was set up

Both apps were built from this written request, as the owner might type it:

Build "Ledgerly", a simple invoicing app for freelancers. People sign up with email and password. Each user can add their own clients and create invoices for them (client, amount, currency, due date, status: draft, sent, paid). A user should only ever see and edit their own clients and invoices. Add a teammate feature: a user can share their invoices with a teammate (by the teammate's email), and the teammate can view those invoices but not change them. Add an admin page where users with the admin role can see every invoice. Keep the design clean and simple. Use the built-in backend for the database and sign-in.

Lovable built the first app from it on its built-in back end. An AI coding assistant built the second from the same request, with its last sentence reading "Use Supabase for the database and sign-in".

The access table was signed before any test ran, and the finding to carry through was chosen from the ranked list before anything was changed. Each copy was rebuilt from its app's exported rules, with made-up users A, B, T and Admin and made-up clients and invoices. Teammate T's share was made the app's own way, by User A calling the app's share function, before every test.

What was covered

  • Every cell of the signed table, on each app: five roles; reads on every table the app uses, and the writes the table names (create, change and delete on invoices and clients, creating a share, giving oneself the admin role).
  • Function calls the app exposes that reach rows in the table, each tried under the signed cell it serves. The Supabase app's admin check answers only about the caller, so it has no cell.
  • The exported rules themselves: tables, row level security switches, policies, grants, functions, views, types, roles and storage settings. Neither export held a storage bucket.
  • The rules query: it opens a read-only transaction and returns no application rows. In both editors, a write tried inside the same kind of transaction was refused: "cannot execute CREATE TABLE in a read-only transaction".
  • Isolation: before any test, each copy was checked for live addresses and keys, and none was found. Every request went through one check that refuses any host but the copy's: 237 attempts in the Lovable run's first full pass and 244 in the Supabase run's, all to the copy.

Not tested: what the copy cannot reproduce

  • The sign-in server. Test users were added directly and their tokens signed on the copy. Sign-up, email confirmation and other sign-in settings were not run.
  • The file storage server. Uploads, downloads and public file links were not run.
  • Server code and edge functions. The Supabase app has none, and the Lovable app's code was not read in this sample.
  • Realtime and the GraphQL endpoint.
  • The API gateway: its key check and rate limits. The key header was still sent.
  • Supabase's refusal of an update or delete with no filter. Every test used a filter.
  • One database extension, supabase_vault, on each copy. No app object uses it.

Not tested: outside this sample

  • The code side of the audit: secrets in the browser bundle or repository, secret-key use, payment checks, input handling, error paths, limits on costly endpoints and dependencies. This sample covers the database rules.
  • A comparison of the Lovable app's migration folders with its rules.
  • A fix through code, a server function deploy, or a fix that changes rows rather than rules.
  • Deleting a share, and the Data API on the storage schema: neither is in the table.

Notes beyond the table

Read from the rules rather than tried as cells, so no expectation was set; the owner decides each.

  • An error message tells whether an email has an account. On both apps the share function answers "No Ledgerly account ..." when no account uses the email (on the Supabase app, no confirmed account) and succeeds otherwise, so any signed-in user can test an email.
  • Shares need no acceptance. Any signed-in user can share their invoices with anyone's email. The recipient becomes a teammate without agreeing, and only the sender can remove the share.
  • The owner's email reaches the teammate through the share row, which the teammate may read (owner decision), although the profile cell itself passes.
  • Grants. On the Lovable app, signed-out and signed-in roles hold every table privilege on the five app tables, so row level security is the only barrier. The Supabase app grants signed-in users only what the app uses and refused signed-out requests on every table before any row rule was reached.

What this sample does not show

  • How often AI-built apps carry this finding: one run on each of two apps cannot say.
  • A Lovable chat fix whose applied text is our tried text: the chat writes its own SQL, so the re-test runs on the export.
  • A client engagement's calls, scope or timing; those are on the service page.

Know who can reach what in your AI-built app, cell by cell

This sample is our own test app. An audit tries your app's access rules on a copy built from your export, starting with a short discovery call.

  1. Email or WhatsApp us
  2. Reply within 1 business day
  3. Free 30-minute discovery call
  4. Written scope and fixed fee within 2 business days of the call