In short
- Lovable: the browser queries the database with a public key, and RLS policies decide what comes back. Replit: the browser calls your API routes, and each route decides.
- Replit separates development from production: separate databases, secrets and Clerk user stores, and Agent cannot modify the production database.
- Replit's shared responsibility model lists access control and penetration testing of your app as yours. Lovable's security page says the same about your app's security requirements.
- Replit's Level 3 scan black-box tests the live Preview. Lovable's built-in scans are static analysis. Neither targets the published address by default.
- Apps in a personal Replit workspace publish as Public by default. Check Sharing before anything else.
On this page
Lovable vs Replit: the short answer
Lovable and Replit both turn a prompt into a hosted app with a database and sign-in. They do it with two different shapes, and the shape decides where a leak can sit. In a Lovable app, the browser reads the database directly, and row level security (RLS) policies decide what each visitor gets. In an app built by Replit Agent, the browser calls an API server, and the code of each route decides.
Neither shape is the safer one. Each moves the same question, who may read this record, to a different place. This page compares the two on that question only, from each vendor's documentation as of 13 November 2026. It names no winner on features or price. For each platform alone, read the Lovable security guide and the Replit security guide.
Where each one puts your data
Lovable stores data in PostgreSQL. Its built-in backend is enabled by default and uses Supabase's open-source foundation, with sign-in, file storage, realtime and edge functions. The app's JavaScript carries a project address and a publishable key, which Lovable describes as safe to be public. Every visitor's browser uses them to query the database.
Replit gives each app PostgreSQL 16 on Replit's own managed infrastructure. A published app gets its own production database, separate from the development one. Replit's docs describe what Agent sets up for sign-in: Clerk's React components in the frontend, and Clerk's Express middleware on the API routes. The database credentials stay on the server. A visitor never queries the database: they call your routes.
| Lovable | Replit | |
|---|---|---|
| Database | PostgreSQL in the built-in backend (Supabase's open-source foundation), or your own Supabase project | PostgreSQL 16 on Replit-managed infrastructure, one database for development and one for production |
| How data leaves | The browser queries tables with a publishable key | The browser calls your API routes; the server queries the database |
| What decides who reads a record | RLS policies on each table | The code in each route: a session check, then an owner filter in the query |
| Sign-in | Built into the backend | Clerk by default on Starter, Core and Pro; Replit Auth by default on Enterprise |
| Secrets | Encrypted Secrets, injected into edge functions and server code, never sent to the browser | Secrets tool, AES-256 at rest, read as environment variables, with a separate set for the published app |
| Who can open the published app | Anyone with the address, then your sign-in and policies | Public, password protected, workspace only or invite only. Personal workspaces default to Public |
| The agent and production data | One backend per project. The SQL editor runs your queries directly and asks for confirmation before destructive statements | Agent cannot modify the production database; it reads it through a read replica |
| Certifications the vendor publishes | SOC 2 Type II, ISO 27001:2022, AIUC-1. Not HIPAA compliant | SOC 2 Type II, GDPR compliance; working toward ISO 27001 |
What each protects by default
On Lovable, the default that matters is in the database. Supabase's documentation says that once RLS is enabled on a table, the publishable key returns no data until you create policies, and that a table without RLS is readable and writable by any role with a grant on it. Lovable says it sets up rules automatically when it builds features that store user data. What it cannot know is whether a policy matches your intent: a policy for signed-in users that never compares the row's owner with auth.uid() gives every account every row.
On Replit, the default that matters is the separation between building and running. Development and production have separate databases, separate secrets and, with Clerk, separate user stores. Agent works on the development side and cannot modify production. That protects your live data from the agent. It does not protect it from a route without a check: a list route that forgets the session answers anyone, and a route that checks the session but queries by id alone lets one customer read another's record.
One Replit default deserves a look before anything else. Apps in a personal workspace publish as Public, and the other options are password protected, workspace only and invite only. An internal tool or a beta with real customer data rarely needs to be public.
The security tools each one gives you
| Lovable | Replit | |
|---|---|---|
| Runs on publish | Quick scan: database rules, known npm vulnerabilities, MCP servers exposed without authentication. It does not read application code | A security scan before publishing. With Block publishing of critical vulnerabilities on, a critical finding stops the publish |
| Free tier of scanning | Quick scan | Level 1: dependency and package checks. It does not review your code or test the running app |
| Code review | Deep scan: all application code across seven areas, started by you | Level 2: Security Agent, model-based review combined with static analysis. Paid plans, billed as Agent usage |
| Test of the running app | Aikido AI pentest, billed by Aikido | Level 3: Level 2 plus an external black-box test of the live Preview. Extra plan and access requirements |
| Stops a publish | Workspace setting, on by default for new Enterprise workspaces | Per-app setting; Enterprise organizations can require it |
Credit where it is due. Replit's Level 3 does what few builders offer inside the product: on apps that use Clerk, it tests once signed out and once as a synthetic user, and creates a second synthetic user when it needs to check an ownership boundary between accounts. Lovable's Deep scan reviews access control and authorization across all your application code, server code included.
The limits are stated by the vendors themselves. Lovable says its built-in scanners perform static analysis and cannot guarantee complete security. Replit's Level 3 targets the Preview. Your published app runs with its own production database, its own secrets and its own Clerk user store, so a clean Preview is a strong sign and still a test of a different environment.
What is the same on both
Whichever you choose, the leak is in the deployed app. It takes one of three forms on either platform:
- The rules on the data. A Lovable policy that lets everyone through and a Replit route with no owner filter produce the same result: a stranger reads your customers' records. CVE-2025-48757 counted 170 Lovable apps out of 1,645 scanned with missing or weak RLS. Nobody has published the same count for API routes, and the bug is at least as common: it is the IDOR.
- Keys in the bundle. Both platforms keep secrets on the server when you store them where they belong. Both ship to every visitor whatever you put in a
VITE_variable or paste into frontend code. Lovable rejectsVITE_names in Secrets for that reason. - Per-user access. Sign-in is handled for you on both. Deciding that user B may not open user A's invoice is your rule to write, in SQL on one side and in a route on the other.
AI features add a fourth. An edge function on Lovable or an /api/chat route on Replit that calls a model without checking the caller lets anyone spend your credits. See unprotected AI endpoints.
A self-check that works on either
Run these on your own app only. The same six steps apply to both; only the place you look changes.
- 1
Check who can open the app
Replit: Tools > Publishing, then Sharing. Lovable: confirm the project itself is private, so its code and chat are not readable by others.
- 2
Run the deepest scan you have
Lovable: the Deep scan from the Security view. Replit: Level 2 or Level 3 from Security Center on a paid plan, Level 1 otherwise. Fix, then publish again: on Replit a fix is not live until you republish.
- 3
Read the lock itself
Lovable: More → Database, Manage, Policies, then the SQL below in the SQL editor. Replit: ask Agent to list every route with its method, whether it requires sign-in, and which table it reads, then read that list.
- 4
Ask the backend with no session
From a terminal, send the request below that matches your platform. A private table or a private route must not return records to a caller with no account.
- 5
Repeat as a second account
Sign up twice. As account B, open account A's records by their ids. Anything but an empty answer, a
403or a404is a leak. - 6
Search what you ship for keys
Paste the published app's JavaScript into the API key leak checker, and search your project for
VITE_to read every value it exposes.
-- 1. Tables in the public schema with row level security off
select tablename
from pg_tables
where schemaname = 'public' and not rowsecurity;
-- 2. Policies that let every caller through
select tablename, policyname, cmd, roles
from pg_policies
where schemaname = 'public'
and (qual = 'true' or with_check = 'true');# Your own app only.
# Lovable: one row of a private table, with only the publishable key
curl "YOUR_SUPABASE_URL/rest/v1/YOUR_TABLE?select=*&limit=1" \
-H "apikey: YOUR_PUBLISHABLE_KEY"
# Replit: one private route, with no cookie and no token
curl -i "https://YOUR-APP.replit.app/api/YOUR_ROUTE"
# Expected on both: an empty list, 401 or 403. Never a record.YOUR_SUPABASE_URL is the VITE_SUPABASE_URL value in your Lovable project's .env. On Replit, use the published address: the Preview is a different environment.What stays your job before real users arrive
- Lovable: every table in
publichas RLS on, and every policy for signed-in users compares the owner withauth.uid() - Replit: every route that returns or changes user data answers
401signed out and filters on the signed-in user's id - Admin screens are protected on the server as well as hidden in React
- No secret key in frontend code or a
VITE_variable, and every key that ever shipped has been rotated, see what to do when an API key leaks - AI routes and functions require a session and have a per-user limit
- Stripe webhooks verify the signature, see Stripe webhook security
- The published app was tested signed out and as a second account after the last publish
What Keybrum tests on each, and what it does not
Keybrum is the automated pentest we build for apps made with AI. It attacks the published address from outside, which is the environment neither vendor's built-in scan targets, and keeps the request that worked for every finding.
On a Lovable app, it reads the table names from your JavaScript and tries to read, insert and update rows as a stranger and as a freshly signed-up account. It reads one account's rows from a second account, calls database functions, lists and uploads to storage buckets, subscribes to realtime channels and sends a short prompt to edge functions that look like AI endpoints.
On a Replit app, it collects the API routes your JavaScript calls and calls each one with no cookie or token. With two accounts, the first creates a marked record and the second asks for it by id, which proves or rules out an IDOR. On apps that use Clerk with open sign-up, it creates a throwaway account for those signed-in tests. It also sends an unsigned event to your Stripe webhook and a short prompt to AI routes.
On both, it looks for secret keys in the bundle, a served .env file and missing security headers. It does not review your code, does not see your Replit workspace or your Lovable project settings, and never tests delete access. Replit's database is not reachable from outside, so Keybrum tests it only through your routes. It attacks only apps whose owner proved ownership.
A one-time report costs €49. Plans start at €29 a month excluding VAT for 5 apps and attack again on every deploy, which on both platforms is when a policy or a route changes.
Questions
Is Replit or Lovable more secure?
Both platforms are SOC 2 Type II attested and both scan before you publish. They differ in where your access rules live: database policies on Lovable, API route code on Replit. Your app leaks or holds depending on those rules, which neither vendor writes for you.
Does Replit use Supabase like Lovable?
Not by default. Replit gives each app PostgreSQL 16 on its own managed infrastructure, reached through your server code. Lovable's built-in backend uses Supabase's open-source foundation and is queried from the browser. If you connect Supabase to a Replit app yourself, the Lovable-style checks on RLS apply to it.
Can Replit Agent delete my production database?
Replit's docs say Agent is not able to modify the production database: it can read it through a read replica, and it works on a separate development database. It protects data from the agent. A route that answers strangers is a separate problem.
Does Replit's AI pentest test my live app?
Replit's Level 3 scan runs an external black-box test of the live Preview, without using your source code. The published app has its own production database, secrets and Clerk user store. Test the published address too, signed out and with two accounts.
Which is better for an app with customer accounts?
Either can hold customer data if the access rules are right. On Lovable, verify the RLS policies on every table. On Replit, verify the session check and the owner filter in every route. Then run the two-account test on the published app.
Sources
- 1.Security overview, Lovable Docs
- 2.Built-in backend, Lovable Docs
- 3.FAQ: tech stack and compliance, Lovable Docs
- 4.Secrets, Lovable Docs
- 5.Control who can access your app's data, Lovable Docs
- 6.Row Level Security, Supabase Docs
- 7.Replit shared responsibility model, Replit Docs
- 8.Security scan levels, Replit Docs
- 9.Black-box pen tests, Replit Docs
- 10.Project Security Center, Replit Docs
- 11.Development and production databases, Replit Docs
- 12.Users & Auth, Replit Docs
- 13.Clerk Auth, Replit Docs
- 14.Secrets, Replit Docs
- 15.Who can access your app, Replit Docs
- 16.Replit security, Replit
- 17.Statement on CVE-2025-48757, Matt Palmer