Short answer: your Lovable, Bolt or Cursor app is production ready when anonymous visitors cannot read or change data they should not, no secret key sits in the browser or the repository, and every permission is checked on the server, not in the page. It also needs tested sign-up and payments, a backup you have restored, alerts that reach a person, and a way to roll back a bad release. Most AI-built apps are good prototypes that miss several of these.
The tools are good at getting a working app built in days; the gap is the production work a demo never shows. Below are eleven problems that turn up in AI-built apps, each with a check and a fix, then a checklist table. If your question is "is my Lovable app secure?", start with the first three.
Why do AI-built apps need a check before launch?
An AI builder writes the app you describe. If the prompt never covered who may read which rows, or what happens when a payment webhook arrives twice, the app has no answer, and the preview will not show it. In a Stanford study presented at ACM CCS 2023, people using an AI assistant wrote significantly less secure code than those without one, and were more likely to believe their code was secure.
The builders now help: Lovable runs a Quick scan when you publish and a Deep scan of the code on request, and Bolt has a security audit in its Publish menu. Run them first. But Lovable's docs still make you responsible for your app's security, and no scanner knows who owns your domain or whether a backup restores.
1. Can anyone read your database without signing in?
Apps on Supabase, which Lovable, Bolt and many Cursor projects use, call the database straight from the browser with a publishable key (the anon key on older projects). That key is public by design: Supabase calls it safe to expose because row-level security (RLS) decides what it can reach. From Supabase's RLS documentation:
- A table without RLS is open to any role with a grant on it, and on existing projects new tables in
publicare granted to the anonymous role by default. - A
using (true)policy foranonlets every visitor read the table, which suits a product catalogue and nothing private. - Tables made in the dashboard get RLS by default; tables made with SQL do not, and AI tools often create tables through SQL migrations.
- Views skip RLS by default, and users can edit their own user metadata, so neither should decide who sees what.
- The secret key (or legacy
service_rolekey) bypasses RLS and belongs only on a server.
CVE-2025-48757 records that insufficient RLS policies in Lovable-generated apps, through 15 April 2025, let unauthenticated attackers read or write database tables; the researcher's write-up lists user details, API keys and payment status as at risk. Lovable disputes it, saying each customer is responsible for their own app's data. Either way, protecting it is your job.
How to check. In the Supabase dashboard, open the Security Advisor and look for "Table publicly accessible" and "Security policy allows unrestricted access". Then test as an outsider would (on your own app only) and list every table's rules.
# Read-only test of your own app, as an anonymous visitor.
# 1. Open your live app with the browser's developer tools on the Network tab.
# 2. Find a request to https://<project-ref>.supabase.co/rest/v1/...
# and copy the project URL and the "apikey" request header.
# 3. Ask for a few rows of each table, with nobody signed in:
curl -s "https://YOUR-PROJECT-REF.supabase.co/rest/v1/profiles?select=*&limit=5" \
-H "apikey: YOUR-PUBLISHABLE-OR-ANON-KEY"
# Rows of data -> anyone on the internet can read this table
# [] -> nothing readable anonymously (or the table is empty)
# 401 with "42501" -> the anonymous role has no access to this table-- Run in the Supabase SQL editor. It only reads the catalog and changes nothing.
-- Tables in the public schema: is RLS on, and what may an anonymous visitor do?
select tablename,
rowsecurity as rls_on,
has_table_privilege('anon', format('public.%I', tablename), 'select') as anon_can_read,
has_table_privilege('anon', format('public.%I', tablename), 'insert') as anon_can_insert,
has_table_privilege('anon', format('public.%I', tablename), 'update') as anon_can_update
from pg_tables
where schemaname = 'public'
order by rowsecurity, tablename;
-- Every policy, who it applies to, and its condition.
-- Watch for roles {anon} or {public} with qual = true, and write policies with no check.
select tablename, policyname, cmd, roles, qual, with_check
from pg_policies
where schemaname = 'public'
order by tablename, cmd;How to fix it. Turn RLS on for every exposed table and add a policy per action that ties each row to its owner with auth.uid(). Keep roles such as "admin" in a table only admins can write, or in app metadata. Set security_invoker on views (Postgres 15 and newer). Move anything that needs the secret key into a server-side function that checks who is calling.
-- Example: a table where each row belongs to one signed-in user.
alter table public.documents enable row level security;
create policy "Users read their own documents"
on public.documents for select
to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users create documents for themselves"
on public.documents for insert
to authenticated
with check ( (select auth.uid()) = user_id );
-- Views: apply the caller's RLS instead of the view owner's (Postgres 15 and newer)
alter view public.document_summaries set (security_invoker = true);2. Are any secret keys in the front end or the repository?
Only publishable keys (Supabase's publishable key, Stripe's pk_ key) are meant to be public. Supabase secret or service_role keys, Stripe sk_ and rk_ keys, AI model keys and email or SMS keys stay on a server. They usually leak in two ways:
- The build bakes them in. In a Vite front end, which Lovable uses, any variable starting with
VITE_is bundled into the code browsers download. That is why Lovable keeps private values in Secrets for server-side functions. - Git keeps history. A deleted key is still in older commits. GitGuardian's 2026 report counted 28.65 million new hardcoded secrets in public GitHub commits in 2025.
How to check. Scan the Git history and the built front end with Gitleaks, as below.
How to fix it. Treat any secret that reached a browser or a commit as public. Rotate it at the provider first, move it to server-side secrets, and only then delete it from the code. Add a secret scan to every push.
# Install Gitleaks (Homebrew shown; binaries and Docker images are on its GitHub page)
brew install gitleaks
# Scan every commit on every branch, with secret values masked in the output.
# In Lovable projects .env is committed on purpose: it should hold only public VITE_ values.
gitleaks git -v --redact --log-opts="--all" .
# Scan the built front end, which is what visitors download
# (dist for Vite; .next/static for Next.js)
npm run build
gitleaks dir -v --redact dist
# Extra check of the build for server-side key formats (prints only the start of each match)
grep -rnoE "sb_secret_[A-Za-z0-9_-]{4}|sk_live_[A-Za-z0-9]{4}|rk_live_[A-Za-z0-9]{4}" dist3. Are permissions checked only in the browser?
Hiding the admin button is not a permission check: anyone can replay the page's requests with a different ID or field. The OWASP Top 10:2025 keeps broken access control at number one, reports some form of it in 100% of the applications tested, and says access control is only effective in trusted server-side code. Typical examples:
- An admin page guarded in React while its data is readable by any signed-in user.
- An
is_adminorplanfield users can edit on their own profile. - A price or credit balance sent from the browser and trusted by the server.
How to check. With two test accounts, replay one account's requests using the other's record IDs, and try admin requests as a normal user (on staging if they change data).
How to fix it. Enforce rules where users cannot edit them: in RLS policies, in server functions that verify the caller's token, and in database constraints. Work out prices and plans on the server from your own records.
4. Does the server validate what users send?
OWASP's input validation guidance is clear that client-side validation can be bypassed. In many AI-built apps the only server is the database, so the database has to do the checking.
How to check. Skip the form and send empty, 100,000-character, negative or wrong-type values straight to the API, then see what was stored.
How to fix it. Add not null, length and check constraints, validate request bodies in server functions with a schema library such as Zod, limit upload size and type, and render user text as plain text.
5. Are sign-up and payments tested?
These flows cost you users or money when they fail, and prototypes rarely test them:
- Sign-up emails stop. Supabase's built-in email service is not meant for production: it sends only to your project team's addresses, at 2 messages an hour.
- Webhooks arrive twice or out of order. Stripe's webhook guide says to verify every signature, skip event IDs you have already processed, and not depend on event order.
- The wrong keys go live. Stripe sandbox secret keys start with
sk_test_, live ones withsk_live_orrk_live_(key types).
How to check. On staging, sign up, confirm the email, sign in, reset the password, pay, fail a payment and cancel. Send Stripe test events with the CLI below.
How to fix it. Use your own email provider, make webhooks signed and duplicate-safe, and run automated end-to-end tests (Playwright or similar) on sign-up and checkout before every release.
# Stripe CLI, in sandbox mode: forward events to your local webhook handler
stripe login
stripe listen --forward-to localhost:4242/webhook
# In a second terminal, send a test event and watch how your handler responds
stripe trigger payment_intent.succeeded6. Do you have a backup you have actually restored?
What the platforms provide:
- Supabase: daily backups on paid plans (7 days on Pro, 14 on Team, up to 30 on Enterprise) and point-in-time recovery as an add-on; Free projects are told to export their own data regularly. Backups exclude files in Storage, and a restore takes the project offline (backups).
- Lovable Cloud: one database-only backup a day, kept for about 14 days (database backups).
- Version history is not a backup. Reverting in Lovable restores code only, and restoring an earlier Bolt version leaves your database unchanged.
How to check. Restore last night's backup into a separate project, point staging at it, sign in, and time it. That is how long you are down on a bad day.
How to fix it. Keep your own scheduled dump outside the platform, copy storage files separately, add point-in-time recovery once losing a day of data would hurt, and write the restore steps down.
# Your own logical backup of a Supabase database with the Supabase CLI
# (needs Docker running). Use the direct connection string from your project's
# database settings. Lovable Cloud projects use Lovable's own export instead.
supabase db dump --remote="YOUR-CONNECTION-STRING" -f roles.sql --role-only
supabase db dump --remote="YOUR-CONNECTION-STRING" -f schema.sql
supabase db dump --remote="YOUR-CONNECTION-STRING" -f data.sql --use-copy --data-only -x "storage.buckets_vectors" -x "storage.vector_indexes"7. Will you know when something breaks?
If a customer's email is how you learn that checkout is broken, you learned late. Prototypes rarely have error tracking or alerts.
How to check. Make a server function throw an error on staging, and see who hears about it and how fast.
How to fix it. Add error tracking to the front end and server functions (Sentry or similar), uptime checks on sign-in and checkout, alerts to two people, and logs kept long enough to investigate a complaint a week later.
8. What stops someone flooding your sign-up, AI or email endpoints?
Every call that sends an email or SMS, or uses a paid AI model, costs you money. OWASP's API security guidance recommends rate limits, plus spending limits or billing alerts with each provider. Supabase Auth has built-in rate limits, but they cover Auth only; your own functions need their own.
How to check. On staging, send each costly request 50 times in a minute and see whether anything stops it.
How to fix it. Limit requests per user and per IP address, add a bot check to sign-up, and set spending caps or alerts with your AI, email and SMS providers.
9. Are your dependencies safe, and can you use their licences?
AI tools add packages freely, and Lovable's Quick scan reports only critical vulnerabilities.
How to check. Run the fuller audit below.
How to fix it. Update or replace vulnerable packages, and review what npm audit fix --force changes as an upgrade, since npm warns it can install breaking major versions. Commit the lockfile, and check copyleft licences such as GPL or AGPL with whoever handles your legal questions.
# Known vulnerabilities in the packages the app ships (skips dev-only tools)
npm audit --omit=dev
# Licence summary of production dependencies (needs Node.js 24 or newer)
npx license-checker-rseidelsohn --production --summary
# Python back end: audit the requirements file
python -m pip install pip-audit
pip-audit -r requirements.txt10. Who owns the accounts?
Fast builds land in whatever accounts were handy: a personal GitHub, a freelancer's hosting, a domain on someone's own card. Before launch, the company should own all of them (builder workspace, repository, hosting, database, domain, app stores, payments, email and paid APIs), with two of your people able to sign in. On Lovable Cloud, Lovable runs the backend, and leaving means exporting the database and files and setting up sign-in and secrets again (Lovable Cloud).
How to check. Fill in the account table in our post on what to secure when your developer leaves, then work through the software handover checklist.
How to fix it. Transfer each account to the company, add a second admin, and move billing to a company card.
11. Can you release a change and roll it back safely?
Publishing straight to the live app is fine for a prototype. With real users, changes go through a staging copy with its own database first. Code rolls back easily; data does not. A migration that dropped a column stays dropped after you revert the code.
How to check. Can you say where changes are tested, which version was the last good one, and how long getting back to it would take?
How to fix it. Keep code and migrations in Git, run migrations on staging first, take a backup before any release that changes the database, and tag releases so the last good version is one step away.
The production-readiness checklist
| Check | How to test it | How to fix it |
|---|---|---|
| 1. Database access rules | Security Advisor, anonymous request, catalog query | RLS on every exposed table, owner-based policies |
| 2. Secrets | Gitleaks on Git history and the build | Rotate, move server-side, scan every push |
| 3. Permissions on the server | Replay requests as another user and a non-admin | Rules in RLS and server functions |
| 4. Input validation | Send empty, oversized and negative values | Constraints, server-side validation, upload limits |
| 5. Sign-up and payments | Full run on staging, Stripe CLI events | Own email provider, safe webhooks, automated tests |
| 6. Backups and restores | Restore last night's backup and time it | Off-site dumps, storage copies, point-in-time recovery |
| 7. Error monitoring and logs | Break a function and see who is alerted | Error tracking, uptime checks, two people alerted |
| 8. Rate limiting | 50 calls a minute to costly endpoints | Per-user and per-IP limits, spending caps |
| 9. Dependencies and licences | npm audit, pip-audit, licence summary |
Update or replace, commit the lockfile |
| 10. Account ownership | List every account and who can sign in | Company-owned, two admins, company billing |
| 11. Deploy and rollback | Name the last good version and the way back | Staging, migrations in Git, backup first |
How MicroPyramid's Production-Readiness Audit works
We start with a Production-Readiness Audit, the fixed-scope first step of our prototype to production work. It gives you:
- A security review of auth, secrets and data access rules.
- A code, test and architecture review.
- A fix list in priority order, and a launch plan.
The fixes then run as a fixed project: the work from this checklist, built and handed back to your team with notes on what changed. After launch, our software maintenance is optional and runs month to month with 30 days' notice.
MicroPyramid has built software for 12+ years (since 2014) and delivered 50+ projects; see our portfolio. About to launch an app built with Lovable, Bolt or Cursor? Tell us what you built and we will show you what the audit would cover.
Frequently Asked Questions
Is Lovable secure enough for real users?
It can be, but that depends on how your app was built, not on the tool. Lovable scans access rules and packages when you publish and reviews code on request, yet its docs make you responsible for your app's security and recommend a professional review for apps handling sensitive data.
Is the Supabase anon key safe to expose?
Yes, as long as row-level security is on. The publishable key (the anon key on older projects) is designed to be public, and RLS limits what it can reach. The secret key and the legacy service_role key bypass RLS and must never reach the browser. Supabase is deprecating the legacy keys by the end of 2026.
Do the Lovable and Bolt security scans replace a review?
No, but run them first. They check code and database settings. They cannot tell you who owns your accounts, whether a backup restores, whether alerts reach anyone, or whether the access rules match how your business actually works.
Do apps built with Cursor have the same problems?
Mostly, yes. Cursor writes code in your own repository on whatever stack you choose, so the specific checks change, but the gaps are the same. If you are not on Supabase, read "RLS policy" in this checklist as the permission checks in your own API.
How do I check whether my Supabase tables are public?
Open the Security Advisor in the Supabase dashboard and look for tables flagged as publicly accessible. Then, on your own app only, request rows from each table with just the publishable key and nobody signed in. If private rows come back, fix the RLS policies before launch.
Should I rewrite my AI-built app before launch?
Usually not. Most AI-built prototypes can be hardened in place, around code that already works. A rewrite makes sense when the data model is wrong for the product, or when rules are spread so widely through the front end that moving them costs more than rebuilding.
What drives the cost of making an AI-built app production ready?
Mostly how much logic sits in the browser, how many user roles and shared records there are, how sensitive the data is, whether tests exist, whether you move off the builder's cloud, and who holds the accounts. The Production-Readiness Audit looks at each of these first, so the scope is known before fixing starts.