Guides · BossCheck team · Updated 2026-10-14

Is Code from Cursor, Lovable or Claude Secure? What to Check Before You Ship

Short answer: AI-written code is not secure or insecure by default. It is unreviewed. These are the mistakes that show up most often, and how to catch them.

Why AI tools produce insecure code

AI coding assistants are optimized to make your request work. When you say "save the high score" or "connect to the database", the shortest path is usually the least safe one: a hard-coded key, a database table anyone can write to, or a server that believes whatever the client sends. The tool also can't see your hosting settings, your database dashboard or who will attack the app, so it can't judge those risks for you.

App builders like Lovable and Bolt make this worse in one specific way: they wire your frontend straight to a backend such as Supabase. That's fine if row level security is set correctly. In March 2025, a security researcher scanned 1,645 Lovable-built sites and found 170 of them (about 10%) with Supabase tables readable or writable by anyone holding the public anon key. It was published as CVE-2025-48757. Lovable disputes the CVE, saying each customer is responsible for securing their own app's data. Lovable later added a security scan, but the researcher reports that it checks whether RLS policies exist, not whether they actually restrict access, so a using (true) policy can still pass. Cursor and Claude Code don't host your backend, so the same mistakes simply land in your repo with nothing checking them.

The 6 most common problems

  1. Secrets in client code. Stripe secret keys, OpenAI keys, Supabase service_role keys or Steam publisher keys placed in frontend files or in VITE_/NEXT_PUBLIC_ variables, which build tools expose to the browser on purpose.
  2. Open databases. Firebase rules left in test mode, or Supabase tables with RLS disabled or a policy of using (true) for writes.
  3. Trusting the client. The browser or game client sends "price: 0", "coins: 99999" or "isAdmin: true" and the server accepts it.
  4. Missing authorization checks. An API route checks that you're logged in, but not that the record you're editing is yours (often called IDOR).
  5. Hallucinated or outdated packages. The assistant suggests a package that doesn't exist (attackers register those names) or an old version with known vulnerabilities.
  6. Debug leftovers. Test endpoints, verbose errors, permissive CORS (*) and admin pages without auth.

A 15-minute self-check

# 1. Look for leaked secrets in files and git history
gitleaks git -v .

# 2. Check dependencies for known vulnerabilities
npm audit          # or: pip-audit, dotnet list package --vulnerable

# 3. Grep for risky patterns
grep -rnE "sk_live_|service_role|PRIVATE KEY|NEXT_PUBLIC_.*(SECRET|KEY)" --exclude-dir=node_modules .

Then open your built site, press F12, and look at the Sources and Network tabs. Anything you can see there, every player can see too. Finally, if you use Supabase, open the dashboard's Security Advisor; if you use Firebase, read your rules and confirm nothing says allow read, write: if true.

Make your AI tool review its own work

AI assistants are much better at finding security bugs when you ask for a review as a separate step, instead of expecting safe code on the first try. Use a prompt like the one below, then verify each finding yourself. A project rules file (AGENTS.md, CLAUDE.md or Cursor rules) that says "never put secrets in client code; always enable RLS; the server validates all input" also prevents many of these mistakes from appearing at all.

Prompt to paste into your AI coding tool

Act as a security reviewer for this project. Check for: secrets in client code or
git history, database tables or rules that allow public writes, server code that
trusts client-sent prices/scores/roles, API routes missing ownership checks,
non-existent or vulnerable dependencies, and debug endpoints. For each issue give
the file, line, severity and a concrete fix. Do not change code until I approve.

Want this checked automatically?

BossCheck is a security scanner for indie games built with AI tools. It's in pre-launch: join the waitlist for early access.

Join the waitlist →

FAQ

Is Cursor code secure?

Cursor generates code that you are responsible for reviewing. It can write secure code, but it often takes shortcuts such as hard-coded keys or missing authorization checks unless you ask for a security review.

Is Lovable safe to use for a real app?

Lovable can be used for real apps, but because it connects your frontend directly to Supabase, you must make sure row level security is enabled and correct on every table before launch. Run its security scan, but also read each policy yourself: the scan has been reported to check that policies exist, not that they restrict access.

Can AI find security bugs in its own code?

Often, yes, especially when asked as a separate review step. It still misses things and sometimes invents issues, so verify each finding.

What's the fastest way to check an AI-built project?

Run a secret scanner like gitleaks, run your package manager's audit command, check your database rules, and look at what your built app exposes in the browser dev tools.

More guides