Vibe Code Guardian
← All posts

How to Audit a Lovable App Before Launch: A Step-by-Step Walkthrough

Lovable builds working features fast, but it does not build the safety checks that production needs. Here is how to audit a Lovable app yourself, from database rules to payment flows, before real users arrive.

Aaron Allen·

You have a Lovable app that works. The preview shows every screen, the flows connect, and you can sign up, create data, and pay for things. It feels finished.

The gap between "works in preview" and "safe for strangers" is where most launches go wrong. Lovable optimises for speed and the happy path. It does not volunteer the things that break when real people use the app: database rules that let anyone read everything, payment keys that ship to the browser, authentication that only works in the frontend, and error handling that swallows problems silently.

This walkthrough shows how to audit a Lovable app yourself. You do not need to be a developer. You need a browser, a terminal for a few curl commands, and a willingness to try to break your own app.

Start with what is publicly visible

Before you log in, check what the world can see.

Open your deployed app in an incognito window. Press F12, go to the Sources tab, and search (Ctrl+Shift+F) for the names of every paid service you use: stripe, openai, supabase, sendgrid, resend, twilio. Also search for sk_live, sk-, service_role, Bearer, secret, api_key.

If a secret key appears in the browser, it is public. Rotate it immediately in the provider dashboard, then move the new key to your hosting provider's environment variables (server-side only). We covered the full cleanup process in our post on exposed API keys in AI-generated code.

While you are in the Sources tab, check whether NEXT_PUBLIC_ or VITE_ prefixes appear on any variable that looks like a secret. Those prefixes mean "send this to the browser." A secret with that prefix is a leak.

Check the database from the outside

If your app uses Supabase, the anon key is public by design. The only protection is row level security (RLS). Test whether RLS is actually working.

Find your project URL and anon key in the Supabase dashboard (Settings > API). Pick a table that holds user data — profiles, orders, messages, documents. In a terminal, run:

curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=5" \
  -H "apikey: YOUR_ANON_KEY" \
  -H "Authorization: Bearer YOUR_ANON_KEY"

If you get real rows back, anyone on the internet can read that table without logging in. Repeat for every table that should be private.

Then log in as a test user, grab the JWT from your browser's Application > Local Storage, and run the same request with that token. Try to read a row that belongs to a different user. If it works, your RLS policies are not filtering by owner.

We wrote a full ten-minute test for this in our Supabase RLS mistakes post.

Test authentication with two accounts

Create two test accounts in your app. As user A, create something: an order, a note, a project. Copy the URL or ID. Log out, log in as user B, and try to open user A's record.

Also try these while logged in as user B:

  • Edit user A's record by changing the ID in the request (check the Network tab for PUT/PATCH requests)

  • Delete user A's record

  • Call any API endpoint directly with user A's ID in the payload

If any of these work, the server is not checking ownership. This is the single most common serious bug in AI-built apps. Our authentication bugs post covers eight variants and how to test each one.

Verify payment flows end to end

Run a real transaction, not a test card. Use a real card in live mode, charge a small amount (£1), then refund it immediately.

Check three things:

  1. The payment actually reaches your Stripe dashboard in live mode (not test mode)

  2. Your webhook receives the payment_intent.succeeded event and your app records the order correctly

  3. If the webhook fails or times out, someone gets an alert

Many Lovable apps quietly stay in Stripe test mode after launch. The dashboard shows payments succeeding in test, but no money arrives.

Also verify that your Stripe publishable key (pk_live_...) is the only Stripe key in the browser. The secret key (sk_live_...) must only exist in your hosting environment variables.

Try to break every form

Open every form in your app. For each field:

  • Submit empty

  • Paste 10,000 characters

  • Enter a negative number for quantities or prices

  • Upload a 50 MB file, then a .exe file

  • Inject <script>alert(1)</script> into text fields

Watch the Network tab. Does the server reject bad input with a 400 response, or does it accept it and the validation only happens in the browser? Browser-only validation is not validation.

Check the browser console while you do this. AI-generated code often logs entire request or response objects during development. Those logs sometimes include user emails, tokens, or IDs.

Confirm error handling does not leak data

Force an error: disconnect your network mid-request, or submit a form that you know will fail. Look at what the user sees.

A friendly "something went wrong" message is fine. A stack trace, a database table name, a file path, or a SQL error is a map of your internals.

Also check whether failed payments, failed email sends, and failed database writes generate any alert for you. If the answer is "a customer would have to tell us," you have a blind spot. Add error tracking (Sentry, LogRocket, or even a simple webhook to Slack) so you find out first.

Check what happens with real data volume

Lovable often fetches entire tables and filters in the browser because it is the shortest path to a working screen. With 20 rows this is instant. With 20,000 rows it downloads megabytes on every page load.

Seed your database with a realistic amount of data (or ask a developer to write a quick script). Then load each page and watch the Network tab for request sizes and response times. Look for:

  • Requests returning thousands of rows

  • No pagination on lists

  • Missing indexes on columns you filter or sort by

If you pay per database read (Supabase, PlanetScale, Neon), this also costs money.

Verify your live configuration matches your local one

Environment variables are the most common cause of "it worked yesterday" failures.

In your hosting provider (Vercel, Netlify, Railway, Render, Coolify), open the environment variables for the production deployment. Compare every key against your local .env file. Common misses:

  • Stripe live keys entered but webhook secret missing

  • Supabase URL present but anon key missing (or vice versa)

  • Email provider (Resend, SendGrid) verified for your domain but FROM address not authorised

  • OAuth redirect URIs (Google, GitHub) missing your production domain

  • Database connection string using a local host instead of the managed instance

A missing or wrong variable often fails silently — the feature just stops working with no error shown to the user.

Test on a phone, on slow 3G, with two people

Open the app on an actual phone. In Chrome DevTools, throttle the connection to "Slow 3G." Have two friends use it at the same time while you watch.

You will find things that never appear on desktop with fast internet: layout shifts that hide buttons, touch targets too small, requests that time out, race conditions when two people edit the same thing.

Separate staging from production

If your test environment uses the same database as production, the first time you clear test data you risk deleting customer data. Ideally you have a staging deployment with its own database, its own Stripe account, its own Supabase project, and its own environment variables.

Also check who can deploy. If a single AI-assisted change goes straight to production with no review, a bad suggestion reaches users in the same minute you accept it. Add a staging gate: deploy to staging, verify, then promote.

What to do with the results

Sort findings into two piles.

Fix before launch: anything involving other people's data, secrets, payments, or access control. These are not negotiable.

Fix in week one: performance, cosmetic issues, missing monitoring, backup verification.

Be suspicious of AI fixes for the first pile. The pattern we see repeatedly: the tool removes the check that caused the error. The "unauthorized" message disappears because the authorisation check was deleted. After any fix to access, secrets, or payments, repeat the original test rather than trusting the explanation.

When to bring in a developer

If the audit turns up more than a few items in the first pile, or if you are not confident assessing the severity of what you found, that is the moment to get a second opinion.

Vibe Code Guardian's launch-readiness audit checks an app against 137 points across 14 areas. A developer confirms each finding by hand and gives you a ranked list of fixes. The free surface check looks at what is publicly visible on a domain you own and takes a few minutes. Neither requires a credit card. Compare the options on the packages page.

If you only have fifteen minutes before you share the link, run the database curl test, the two-account access test, and the browser secrets search. Those three catch the problems that cost the most when they go wrong.

Want a developer to look at your app?

Built your app with AI tools? Run the free surface check yourself in a few minutes. Nothing to buy, and we never look at your app unless you run it.