Netcraft

// From Lovable, Bolt or Replit to production

What are the security risks of vibe coding, and how do you check for them?

The main risks in vibe-coded apps are database tables readable with the public key, secret API keys in the browser, permissions checked only in the interface, payments granted by the client, AI endpoints anyone can call, and unreviewed packages. AI tools build what works when you click through it, not what an attacker would try. Each has a quick test.

Want it done for you? Vibe-code to Production: from €1,500, fixed quote in 24h →

Gabriel Cazaciuc

By , Founder & lead developer, Netcraft Digital

Last updated

Key facts

Lovable's own security checks
“Can't guarantee that your app is secure or replace a full security review”
Source: Lovable docs, Nov 2026
VITE_ environment variables
Embedded in the browser bundle at build time
Source: Lovable docs, Nov 2026
Supabase secret key
Bypasses row-level security
Source: Supabase docs, Nov 2026
Stripe webhook events
Can arrive more than once and in any order
Source: Stripe docs, Nov 2026
Security audit and fixes with us
From €1,500, 3–4 days
Source: Our fixed-price offer, Nov 2026

Why are vibe-coded apps less secure?

Because the feedback loop only checks what you can see. You prompt, the preview works, you move on. Security failures do not show up in the preview: a table anyone can read looks exactly like a table only you can read when you are the one logged in.

The code itself is often reasonable. The gaps are in decisions nobody made: who may read this row, where this key lives, who may call this function, what happens if the same payment event arrives twice. AI tools fill those gaps with whatever makes the error go away.

What are the most common risks?

These seven patterns are the ones to check first. Each one has a test you can run without reading the whole codebase.

RiskHow it happensHow to test
Open database tablesMissing or too-wide row-level security policiesQuery each table with the public key and no login
Secret keys in the browserThe AI adds VITE_OPENAI_API_KEY or a Stripe secret to make a call work from the frontendSearch the built JavaScript for sk-, sk_live, sb_secret, service_role
Checks only in the interfaceThe admin page is hidden for normal users, but its API calls are not protectedCall the admin endpoints or tables while logged in as a normal user
Payments granted by the clientThe app sets “paid” after the redirect to /successOpen /success directly, or update your own plan column from the console
Open AI endpointsA function calls the AI model for anyone, with no login, rate limit or size limitCall the function in a loop from a script and watch the bill
Unreviewed packagesThe AI installs packages that are outdated, abandoned or not the ones you meantRun npm audit and check each new dependency's name and publisher
Regressions after promptsA fix for one error removes a check somewhere elseRe-run all of the tests above after every large change

How do secret keys end up in the browser?

Through environment variables with a public prefix. In Vite apps, which includes most Lovable and Bolt projects, any variable whose name starts with VITE_ is copied into the JavaScript bundle at build time. A typical way it happens: a server function that calls the AI provider fails, and the fix that makes the error go away is to move the call to the browser with a VITE_ variable for the key. The feature works, and the key is now public.

Anyone who opens the developer tools can copy it and spend your credits with the AI provider, or, with a Stripe secret key, issue refunds and read customer data. Test it after every build:

npm run build
grep -rEo "sk-[A-Za-z0-9_-]{20,}|sk_live_[A-Za-z0-9]+|rk_live_[A-Za-z0-9]+|sb_secret_[A-Za-z0-9_-]+|service_role" dist/ | head

Any match means the key must be rotated at the provider and the call moved to server code. The only Supabase key that may appear is the publishable or anon key.

Why is the database the biggest risk?

Because it holds everything, and in Supabase-based builders the browser talks to it directly. Row-level security is the only barrier, and a single table without correct policies exposes all its rows to anyone with the public key. The step-by-step check, with SQL, is in the Lovable + Supabase security checklist.

What about payments and AI features?

Both are places where an attacker gains money or costs you money, so they need checks on the server. For payments, access must come from a Stripe webhook verified on your server, and the handler must ignore duplicates, because Stripe can send the same event more than once and in any order. Details in how to add Stripe to a Lovable app.

For AI features, every endpoint that calls a model needs a logged-in user, a rate limit per user, a maximum input size and a daily budget. Without them, one script can run up a bill in a night. We cover limits and budgets in how to control AI costs.

Do AI security scanners solve this?

They help with the mechanical part. Lovable runs automatic checks before publishing for missing row-level security, rules that let everyone in, public tool access and vulnerable dependencies. Those findings do not block publishing unless a workspace admin turns that on, and Lovable states that the checks cannot guarantee security or replace a review.

A scanner can tell that a policy exists. It cannot tell that users should only see their own team's invoices, or that the plan column must not be editable. That part needs someone who knows what the app is supposed to allow.

What should I check before launch?

Pre-launch security check for vibe-coded apps

  • Every table returns nothing to an anonymous request with the public key
  • A logged-in user cannot read or change another user's rows
  • Users cannot write their own role, plan, credits or payment status
  • No secret keys in the built JavaScript or in the git history
  • Admin actions are checked on the server, not only hidden in the interface
  • Access after payment comes from a verified Stripe webhook; duplicate events are ignored
  • AI endpoints require login and have rate limits, size limits and a budget
  • Private files are in private storage, served with signed URLs
  • npm audit has no high or critical findings you have not reviewed
  • Errors and failed payments reach you, not only the user
  • You re-ran this list after the last large prompt

If AI generates content that users rely on, add a check on the output too: how to verify AI output before users see it. Security is one of five areas on the production checklist for AI-built apps. When the app will hold payments or private data, it is also the point where hiring a developer makes sense.

// FAQ

Frequently asked questions

Another question? Write to us; you get an answer from the developer within one working day.

Is vibe coding safe for production?

It can be, if someone checks the parts the preview does not show: database access rules, keys, server-side checks and payments. The interface code is rarely the problem.

What is the biggest security risk in vibe-coded apps?

Database tables that anyone with the public key can read, because row-level security is missing or too permissive. It exposes all the data at once and is invisible in the preview.

Can I ask the AI to make my app secure?

You can ask it to fix specific findings, and it usually does. A general “make it secure” prompt does not tell it what your app should allow, so it cannot replace the tests in the checklist.

Do Lovable and Bolt check security for me?

Lovable runs automatic checks before publishing and says they cannot guarantee security. Treat any built-in scan as a first pass, not a sign-off.

How much does a security review of an AI-built app cost?

With us, an audit with fixes and a written report starts at €1,500 at a fixed price and takes 3–4 days.

// From Lovable, Bolt or Replit to production

Keep reading

// From Lovable, Bolt or Replit to production

How do you secure the Supabase database behind a Lovable app?

Enable row-level security (RLS) on every table in the public schema, write policies that compare (select auth.uid()) with the row owner for reads and writes, keep the secret key out of the browser, make private storage buckets private, and check who calls each edge function. Lovable's pre-publish scan flags missing RLS, but it cannot prove your policies are correct.

Read the guide

// From Lovable, Bolt or Replit to production

How do you add Stripe payments to a Lovable app?

Lovable offers two paths: built-in payments, where Lovable sets up Paddle or Stripe for you (paid plan required), or your own Stripe account connected with a restricted key. The own-account setup checks subscription status with Stripe at sign-in and has webhooks off by default. For production, add a verified webhook that writes each user's access to your database.

Read the guide

// From Lovable, Bolt or Replit to production

When should you hire a developer for an app built with AI tools?

Hire a developer before real users pay or upload private data, when the same bug returns after several prompts, when you need payments, SEO or an integration the builder cannot finish, or when credits spent on one fix exceed what the fix is worth. Before that point, keep building yourself. Fixed-price production work starts at €1,500 with us.

Read the guide

// Start here

How do you take a Lovable, Bolt or Replit app to production?

To take an AI-built app to production you need five things the builder rarely finishes: database access rules on every table, payments confirmed on the server, hosting and a database in your own name, pages Google can read, and code you can change without breaking it. With a developer this usually takes 3–7 days and costs €1,500–3,000.

Read the guide

Vibe-code to Production, at a fixed price

Security, payments, hosting, domain and SEO for apps made with AI builders. From €1,500, 3–7 days. Written scope and price within 24 hours.