If you built your product with Lovable, Bolt, v0, Cursor or Replit Agent, you probably have something that a few months ago would have taken a team and a quarter: working screens, login, a database, maybe Stripe checkout. To show investors or validate with twenty people you know, it is a very good way to work.
The trouble starts when strangers get in. The demo is used by one person (you), following the expected path with test data. In production there is a second user trying to read the first user’s data, someone opening the browser’s developer tools, traffic that costs money on every request, a schema change with real data inside, and a failure at three in the morning. This post goes through what usually breaks in that jump, why, and how to check each point yourself.
Why the demo gives no warning
Andrej Karpathy coined “vibe coding” in February 2025 for a way of programming where you accept what the model generates without reading the code. You judge the result by what appears on screen, and none of the failures in this list appear on screen: a table anyone can read looks exactly like a protected one.
There is public data on what that produces:
- In May 2025 CVE-2025-48757 was published (CVSS 9.3). Matt Palmer checked 1,645 apps from Lovable’s public showcase and found 170 whose tables could be read or written without logging in, across 303 endpoints: user emails, payment details, transactions and third-party API keys. Lovable disputes the CVE, arguing that protecting each app’s data is its customer’s responsibility. That is, yours.
- In July 2025, during a public trial by Jason Lemkin (SaaStr), Replit’s agent deleted the production database in the middle of a code freeze: records for more than 1,200 executives and 1,190 companies. Replit’s CEO then announced that development and production databases would be separated automatically.
- Veracode asked more than 100 models to complete 80 coding tasks with known risk: in 45% of cases they introduced an OWASP Top 10 vulnerability, and against XSS they failed 86% of the time.
None of this means AI-generated code is useless. It means someone has to review what the model had no way of knowing: who should see each piece of data, how much a request can cost, and what happens if something gets deleted.
1. Data: RLS in Supabase, rules in Firebase
Lovable and Bolt usually connect the app to Supabase. The frontend talks straight to the database with a public key (the anon key or publishable key), which ships in the browser’s JavaScript and is meant to be public. The only thing stopping that key from reading any table is Row Level Security (RLS) policies. Supabase’s documentation is blunt about it: a table in an exposed schema without RLS can be read and written by any role with a grant on it.
Three typical failures:
- RLS switched off on tables created by hand in the SQL editor or added by the agent in a later iteration.
- RLS on, with a policy that leaves everything open, such as
using (true)for theanonrole. Some tools’ security scanners only check that some policy exists; Palmer pointed out exactly that about the scanner Lovable launched in April 2025. - Read policies done right, write policies forgotten. If a user can update their own
profilesrow and that table holds therolecolumn, they can make themselves an admin.
How to check it. In the Supabase SQL editor:
-- Tables in the public schema with RLS switched off
select tablename from pg_tables
where schemaname = 'public' and rowsecurity = false;
-- Existing policies: look for "true" in qual or with_check
select tablename, policyname, roles, cmd, qual, with_check
from pg_policies where schemaname = 'public';
And from outside, the way an attacker would, using the public key you find in your own site’s code:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*" \
-H "apikey: YOUR_ANON_KEY"
If that returns rows without a session, the table is open. Repeat for every table holding personal or business data.
In Firebase the equivalent is the Firestore and Storage security rules. Test-mode rules open reads and writes to anyone for a set period, and when it expires someone extends it so the app works again. Look for allow read, write: if true or conditions that only check the date.
2. Secret keys in the frontend and in git history
Builders that generate Vite projects put any variable starting with VITE_ into the final JavaScript; in Next.js (what v0 usually produces) the same happens with NEXT_PUBLIC_. Vite’s documentation warns that those variables must not hold API keys. When the model needs to call OpenAI or Stripe and the project has no backend, the shortest path to “it works” is putting the key there.
Keys that cannot be in the browser: Supabase’s service_role (it bypasses every RLS policy), Stripe secret keys (sk_live_), AI provider keys, email-sending keys and any token with write permissions.
npm run build
grep -rEo "service_role|sk_live_[A-Za-z0-9]{8,}|sk-[A-Za-z0-9_-]{20,}" dist/ | sort -u
# Git history counts too: a key removed in a later commit is still there
git log -p | grep -E "service_role|sk_live_|sk-[A-Za-z0-9_-]{20,}" | head
If anything shows up, deleting the line does not help: the key has already been public. You need to issue a new one, move it to a backend or server function, revoke the old one and check its usage in the provider’s dashboard. If you would rather we handle it, see exposed credentials and secret rotation.
3. Authentication is not authorisation
Having a login only means the app knows who you are. What fails in generated code is the second question: whether that user may see or change that record. The usual patterns:
- Routes like
/api/invoices/123that return invoice 123 to anyone with a session, without checking it belongs to them. Change the number and you read other people’s (what OWASP calls BOLA or IDOR). - Server functions that receive
user_idin the request body and trust it, instead of taking it from the session token. - Admin screens hidden from the menu but reachable by typing the URL, because the role check lives only in the frontend.
The most useful test takes ten minutes: create two accounts, A and B. As A, open developer tools, copy a request that reads or modifies your own data, swap the identifier for one of B’s and replay it. If it works, you have a hole, even with RLS on every table.
4. Schema changes, backups and separate environments
The Replit case is the extreme version of something common: the agent works against the same database your customers use. With test data it did not matter; with real data, every “add a field to users” is a production migration made without review.
What to check:
- Are migrations versioned? In a Supabase project, a
supabase/migrationsfolder in the repository with each schema change in its own file. Without it you cannot rebuild the database or know what changed and when. - Is there a separate staging environment? A second Supabase or Firebase project where you and the agent test before touching production.
- Are there backups, and has anyone restored one? Check in the dashboard which backups your plan includes, how often and for how many days. Then restore one into a separate project. A backup you have never restored is an assumption.
5. Tests and a minimal CI
Every instruction to the agent can touch files you did not ask about. Without tests, fixing the price calculation breaks sign-up and you find out from a customer. You do not need high coverage to start: five or six end-to-end tests of the flows that make you money or get you into trouble (sign-up, login, payment, “user B cannot see A’s data”), running on every push with GitHub Actions or similar. With the permission test from the previous section automated, an agent change that reopens a table gets caught before deploy.
6. Dependencies and licences
A model can suggest packages that do not exist. In a study presented at USENIX Security 2025, with 576,000 code samples from 16 models, the average share of invented packages was at least 5.2% for commercial models and 21.7% for open models, with 205,474 distinct names. If someone registers one of those names with malicious code, the next npm install installs it.
npm ls --depth=0 # your direct dependencies; does any look unfamiliar?
npm audit --omit=dev # known vulnerabilities in what reaches production
npx license-checker --summary # licences: look for AGPL or GPL if you sell a SaaS
Also check the Node version in your deployment: if it is out of support, it gets no security patches. For that specific case we offer a Node.js security patch.
7. Costs that grow with use (or abuse)
Two mechanisms turn a small app into a large bill:
- An AI provider key in the frontend (section 2) lets anyone spend your quota on their own things.
- An endpoint that calls an LLM or a paid API with no login and no rate limit. A script calling it in a loop runs up a cost on every call. With serverless functions, a badly written retry loop does the same without any attacker.
The minimum: a spending cap in each provider’s dashboard, budget alerts on your hosting, a per-user rate limit on expensive endpoints, and a session required on those endpoints. To estimate what each model call costs at your volume, see the breakdown in the real cost of running LLMs in production.
8. Who owns each account
This section has no code. It is the one that blocks a company sale, a vendor switch or a co-founder’s exit when the repository or the domain belongs to someone else. List every service, the email that administers it, who pays and whether it has two-factor authentication:
| Service | What to check |
|---|---|
| Repository (GitHub) | That it lives in a company organisation, not in the personal account of whoever started it |
| Domain and DNS | Registrant and renewal email in the company’s name |
| Supabase / Firebase | Project inside the company’s organisation, with more than one admin |
| Hosting (Vercel, Netlify…) | Company team, not a personal account |
| Stripe, transactional email, AI providers | Company account and card; keys issued from that account |
| The AI tool | Who holds the project and whether the code is synced to your repository |
If a freelancer or agency built the MVP on their accounts, ask for the transfer now, while the relationship is good.
9. GDPR: where the data lives and who processes it
As soon as you store data about people in the EU, you are the controller, and every provider that touches it (database, hosting, email, the AI model you send user text to) is a processor. Article 28 of the GDPR requires a processing agreement with each one; almost all offer it as a DPA on their site, but someone has to accept it and keep a record.
The region is chosen when the project is created and cannot be changed later: Supabase does not let you change the region of an existing project, so you have to create a new one in the right region and migrate. If your project was created in the US with the default option and your users are in the EU, you have an international transfer to justify, or a migration to do. Also check which personal data you send to AI providers inside prompts, and that your privacy policy names all those providers.
The list, on one page
- RLS on for every table in
public, notruepolicies foranon, tested withcurlwithout a session. - Zero secrets in the bundle or in git history; any that show up, rotated.
- A/B permission test passed on every screen that reads or changes data.
- Migrations in the repository, a separate staging environment and a backup restored at least once.
- Tests for critical flows running on every push.
- Dependencies reviewed: no unknown packages, no high-severity vulnerabilities, compatible licences.
- Spending caps at every provider and rate limits on expensive endpoints.
- Every account in the company’s name, with two admins and two-factor authentication.
- GDPR: data region, a DPA with each provider and an up-to-date privacy policy.
- Lock down the data
- Rotate secrets
- Backups and environments
- Tests on critical flows
- Decide what to do with the code
Order matters: if tables are open, everything else can wait an afternoon. If there are already signs someone got in (users you do not recognise, changed data, API charges that are not yours), start with hacked website before touching anything.
Harden, refactor or rebuild
After the review comes the decision about the code. There is no default answer; it depends on what turns up:
| Decision | When it makes sense | What it involves |
|---|---|---|
| Keep and harden | The data model fits the business, the failures are configuration (RLS, keys, accounts) and the code is readable | Fix the list above, add tests and CI, and keep iterating with the tool behind a staging environment |
| Refactor in parts | What users see works, but business logic is scattered across the frontend, payments or permissions are decided in the browser, or the same calculation is copied in five places | Move sensitive logic to a backend or server functions, unify the data model and keep the screens |
| Rebuild | The data model cannot carry the real business (multi-company, roles, invoicing), every change breaks something else, or there are requirements the platform does not cover (on-premise, ERP integrations, audit trails) | Use the MVP as a living specification: flows, screens and what you learned from users. It is rewritten with an architecture designed for that |
A rebuild rarely starts from zero: the MVP already solved the most expensive part, which is knowing what to build. To put numbers on each option, how to estimate a software budget explains where the hours come from.
How we do it at Soamee
We review apps built with these tools against this same list, on your repository and your accounts, and hand you what is open, what to fix first and which of the three decisions above we recommend, with the reason. That is our software technical audit. If the conclusion is to rebuild, we do it as part of MVP for startups or as custom software development, depending on your stage; from idea to product in 10 weeks shows how we approach that rebuild.
If you want a first opinion on your app before deciding anything, tell us about it in a free consultation.
Sources
- CVE-2025-48757: Tenable entry · Matt Palmer’s statement
- Replit and SaaStr: Fortune, 23 Jul 2025
- Veracode: 2025 GenAI Code Security Report
- Invented packages: Spracklen et al., USENIX Security 2025
- Supabase: Row Level Security · changing a project’s region
- Vite: environment variables