AI-Generated App Security Checklist: Lovable, Cursor & Claude Code

A
AI Dev Expert Author
📅 ⏱ 12 min read

Short Answer: Is an AI-Generated App Secure by Default?

No. An app built with Lovable, Cursor, or Claude Code is not secure by default, even if it demos perfectly. AI tools routinely leave authorization checks incomplete, database rules too open, secrets in the wrong place, and dependencies unreviewed. The checklist below is the review to run before launch.

Before an AI-generated app handles real users, payments, or personal data, work through this AI-generated code security checklist — identity, database permissions, secrets, APIs, dependencies, input validation, and testing — then test it as an attacker would, not just as its owner.

This guide is that missing review. If you would rather have it done for you, see our security services.

Why AI-Generated Apps Have Specific Risks

  • Plausible but incomplete code. The model handles the happy path; permission checks for a second user, an admin, or a logged-out visitor are omitted first.
  • Fixes that widen access. When a query fails, the fastest AI fix is often to loosen the rule — a policy allowing everything, a disabled check, a public endpoint. The error disappears; so does the protection.
  • Secrets handled casually. Keys end up in frontend code, committed .env files, or prompts and logs.
  • Dependencies chosen without review, including outdated or similarly named packages — the supply-chain risk in the OWASP Top 10 for LLM Applications.
  • AI-specific risks. If your app calls an LLM, you also inherit prompt injection (LLM01), sensitive information disclosure (LLM02), excessive agency (LLM06), and unbounded consumption (LLM10). OWASP notes there is no fool-proof prevention for prompt injection, so limit what the model can reach and do.
  • No threat model. “What happens if a signed-in user changes an ID in the URL?” catches the most common serious flaw in AI-built apps.

Our breakdown of the Binance hack and its security lessons shows attackers going for keys and overlooked access paths — not the feature you polished most.

1. Authentication and Authorization

Authentication asks who are you? Authorization asks what may you do? AI-generated apps usually implement the first and improvise the second.

Authentication checklist

  • [ ] Email confirmation on, if your app trusts an email address as identity
  • [ ] Password reset and magic links expire and stop working after use
  • [ ] Multi-factor authentication available — and required for admin accounts
  • [ ] Sessions expire, refresh safely, and are revoked on logout and password change
  • [ ] OAuth redirect URLs list only your production domains — no localhost or preview URLs left live
  • [ ] Login endpoints rate-limited against automated guessing

Authorization checklist

Broken object-level authorization is API1:2023 in the OWASP API Security Top 10 for a reason: it is everywhere, and AI tools reproduce it faithfully.

  • [ ] Every API route and server function checks the caller’s role on the server — never only by hiding a button in the UI
  • [ ] Every lookup is scoped to the caller (owner_id = current user), not just id = the ID in the request
  • [ ] Admin routes deny by default and allow named roles only
  • [ ] Two-account test passed: Account A cannot read, edit, or delete Account B’s records by changing an ID

Remediation example. A Lovable-built booking app let any signed-in user view any invoice by incrementing the invoice number — invisible in normal use, because the UI never showed other invoices. Fix: scope the invoice query to the signed-in user on the server, and add a second-account test that must receive a 403. Under a day’s work removed a full billing-data exposure.

2. Exposed Secrets: Assume the Frontend Is Public

Everything shipped to the browser is public: bundled JavaScript, client-side environment variables, and anything in a public repository. Lovable’s security best practices make the same point: frontend code can be inspected and bypassed, so it must never hold secrets or make security decisions.

  • [ ] No payment secret keys, database passwords, or service-role keys in frontend code or client variables
  • [ ] Secrets live in the platform secret store or server-side environment; server code calls third-party APIs for the user
  • [ ] .env files are in .gitignore — and you checked repository history, because deleting a key from the latest commit does not remove it from history
  • [ ] Any key ever committed, shipped to a browser, or pasted into a public prompt is rotated, not just removed
  • [ ] Each service gets its own scoped key, so one leak does not become every system
  • [ ] Secret scanning is enabled on your repository

Remediation example. A Cursor-built dashboard shipped a payment secret key in a client-side variable because the AI placed all API calls in the frontend. Moving that call into a server function and rotating the key closed the hole — with no visible change to the app, which is why this flaw survives demos.

Guardrail your coding tools too: use ignore files (such as .cursorignore) and permissions so the agent cannot read credential files. Cursor documents this in its Agent Security documentation.

3. Database Permissions and Row-Level Security

This is the highest-impact section for Lovable apps and any app where the browser talks directly to the database — most commonly Supabase. There, the public (anon/publishable) key is meant to be visible. What protects your data is Row-Level Security (RLS): Postgres rules deciding which rows each user can read or write. Supabase’s Row Level Security documentation is explicit: enable RLS on every exposed table, and set grants and policies deliberately.

  • [ ] RLS enabled on every exposed table — including logs, settings, and “internal” tables, which get RLS with no public policies at all
  • [ ] Separate policies for select, insert, update, and delete; a read policy does not protect writes
  • [ ] Policies compare the row owner to the authenticated user (in Supabase, auth.uid()), and inserts use WITH CHECK so users cannot create rows for someone else
  • [ ] No policy uses USING (true) for user data — that pattern usually appears as a quick fix for a permission error; treat finding one as a finding
  • [ ] Views and elevated functions do not bypass your rules, and storage buckets have their own policies
  • [ ] The service-role/secret key, which bypasses RLS, appears only in server code you control — and that code checks permissions itself
  • [ ] Your platform’s security advisor is clear of RLS warnings — Supabase’s production checklist lists RLS on all tables as a launch requirement

Two-minute test. In a private browser window, logged out, request one of your tables through the public API using only the public key (a developer can do this with one curl command). If real user rows come back, that table is effectively public. Fix it before anything else here.

The principle applies beyond Supabase: write down, table by table, who can read and write what, then test the negative cases. For apps that have outgrown a generated backend, a properly scoped backend is part of our custom web apps work.

4. Dependency and Supply-Chain Vulnerabilities

AI tools install packages quickly and explain them confidently. Neither is evidence a package is safe, current, or even the one you intended.

  • [ ] Run your package audit (for example, npm audit); resolve critical and high findings before launch, or document why each does not apply
  • [ ] Enable automated dependency updates and alerts. GitHub’s Dependabot documentation covers configuration, including private registries; pair it with secret scanning
  • [ ] Commit the lockfile; review new packages in pull requests, confirm each is maintained and canonical (not a similarly named imitation), and remove unused packages the generator added
  • [ ] Repeat the audit on a schedule. The NIST Secure Software Development Framework (SP 800-218) treats responding to vulnerabilities as a continuing practice, not a launch event

As our PHP2Shell write-up shows, once a serious flaw is public, exploitation begins quickly — the teams that fare best already know what they run.

5. API Security

Test generated Edge Functions, server routes, and backends against the authorization-first mindset of the OWASP API Top 10:

Risk area Check Typical AI-generated flaw
Object-level authorization (API1) Every object lookup scoped to the caller Fetching any record by ID alone
Authentication (API2) Tokens validated on every route A route added later with no auth check
Property-level authorization (API3) Responses expose only needed fields; clients cannot set protected fields Returning the full user object; accepting is_admin from the client
Resource consumption (API4) Rate, payload, and timeout limits Unbounded AI or email endpoints anyone can call repeatedly
Function-level authorization (API5) Admin functions require an admin role, server-side Admin endpoint “protected” by an unlinked URL
SSRF (API7) Server-side URL fetching uses an allowlist A “fetch this URL” feature that can reach internal addresses
Misconfiguration (API8) CORS restricted to your domains; errors leak no stack traces or SQL Wildcard CORS on authenticated endpoints

If your app calls third-party or LLM APIs, add two rules: validate and bound everything those APIs return before using it (API10, unsafe consumption), and put per-user quotas and spend caps on AI endpoints so one account cannot run up your bill — unbounded consumption in product form. Adding AI features to an existing product? Our AI integrations work starts from exactly these controls.

6. Input Validation and Output Handling

AI-generated code tends to trust input, because trusting input makes the demo shorter. Reverse that assumption:

  • [ ] Validate type, length, range, and allowed values on the server for every field; client validation is user experience only
  • [ ] Use parameterized queries or safe ORM methods; never build SQL or shell commands by concatenating user input
  • [ ] Render user content as text by default; if rich text is required, sanitize it with a maintained library — improper output handling is how stored cross-site scripting enters AI-built apps
  • [ ] Validate uploads by type and size, store them outside executable paths, and serve them with safe content types
  • [ ] Treat AI-generated output as untrusted input: validate it before it reaches the browser, a query, an email, or another API
  • [ ] Users see generic error messages; detailed errors go to your logs only

7. Security Testing: Test Like an Outsider

Minimum pre-launch set:

  1. Two-account test. With Account A signed in, replay Account B’s view, edit, delete, and export requests. Every one must fail.
  2. Logged-out test. Repeat key API calls with no session. No private data may appear.
  3. Role test. Call every admin endpoint as a regular user. Expect 403s throughout.
  4. Secrets scan. Scan the repository and the built frontend bundle for key patterns and your own key prefixes.
  5. Dependency audit. Fix or document every critical/high item.
  6. Abuse test. Oversized payloads, malformed JSON, script tags in every text field, rapid repeated login and AI calls. The app should reject, sanitize, or throttle — never error open.
  7. Restore test. Restore your latest backup into a separate environment. A backup never restored is a hope, not a backup.

8. Performance and Load Testing

An app that falls over under modest load is an availability incident waiting for a trigger. Performance is part of production readiness.

  • [ ] Load-test top flows (sign-in, dashboard, search, checkout/booking) at several times expected peak, not at average
  • [ ] Hunt the classic generated-code patterns: a query per row (N+1), list endpoints with no pagination, full-size images, AI calls made synchronously where a queue belongs
  • [ ] Set API timeouts and limits so a slow dependency degrades one feature, not the whole app
  • [ ] Confirm indexes and caching for your heaviest reads before buying a bigger server

Fix queries and payloads first — the focus of our performance optimization service — and only then scale infrastructure.

9. Backup and Recovery

  • [ ] Automatic database backups, stored separately from the production account, with file storage and critical configuration (including encryption keys and secret values) covered too — a database alone does not rebuild the app
  • [ ] At least one full restore performed and timed, with steps written down: that note is your recovery plan
  • [ ] Backup access restricted (backup access is production access), and soft-delete or retention windows guard against accidents and compromised accounts

10. Production Readiness Checklist

Do not launch with real customer data until every box is checked, or consciously accepted in writing.

  • [ ] Authentication hardened; MFA on admin/owner accounts across app, database, hosting, repository, and registrar
  • [ ] Authorization passed the two-account and role tests
  • [ ] RLS/database permissions enabled, reviewed, advisor warnings cleared
  • [ ] No secrets in frontend, repository, or history; exposed keys rotated
  • [ ] Dependency audit clean or documented; automated updates and secret scanning on
  • [ ] API rate limits, CORS, error handling, and AI quotas configured
  • [ ] Server-side input validation and safe output handling in place
  • [ ] Security test set passed and saved for regression use
  • [ ] Load test passed at several times expected peak
  • [ ] Backup restored successfully in a test environment
  • [ ] Logging on for auth events, permission failures, and errors — with alerts someone actually reviews
  • [ ] Privacy basics in place, and a named person owns updates and incident response after launch

When to Hire a Professional

Hire a professional review when any of these are true (otherwise, work the checklist yourself):

  • The app handles payments, health, financial, children’s, or other sensitive personal data
  • Real customers already use it, or a business depends on it for revenue
  • You found a USING (true) policy, a secret in the frontend, or a failed two-account test — and fixing one issue raises the question of what else is there
  • An AI tool “fixed” a security error you did not fully understand
  • A client, partner, or insurer asks how the app was reviewed, and you need an answer you can stand behind

A professional review is not a rewrite: it is a focused pass over the areas above, plus a written fix list ordered by risk. That is the work our security team does for Lovable, Cursor, and Claude Code builds.

Frequently Asked Questions About the AI-Generated Code Security Checklist

Is the Supabase anon key a secret?

No. It is designed to be public and identifies your project. Your protection is RLS plus correct grants. The service-role/secret key — which bypasses RLS — must never reach the browser.

My AI tool has a built-in security scan. Is that enough?

It is a good first pass — Lovable, for example, runs publish-time checks and surfaces Supabase Security Advisor findings — but its documentation still tells you to review RLS, secrets, and authentication yourself. A scanner catches known patterns; the two-account test catches your app’s logic. Use both.

Can I ask the AI to fix the issues it created?

Often, yes — with supervision. Give it one finding at a time, require the restrictive fix (“scope this policy to auth.uid()“, not “make the error go away”), and re-run your negative tests after each change. A first pass on a small app typically takes half a day to a day, including common fixes.

Sources

Frameworks checked November 2026 — confirm details on the linked official pages.

Get a Security Review Before You Scale

If your AI-built app is about to take on real users, a focused review now is far cheaper than an incident later. Tell us what you built and what data it holds — no obligation to hire us for the fixes.

Get a quote for a security review

Found this useful? Share → 𝕏 Twitter in LinkedIn
A

About the Author

AI Dev Expert

Leave a Reply

Your email address will not be published. Required fields are marked *

𝕏 in
Client Reviews

Trusted by 5K+ Businesses Worldwide

Real feedback from the clients we work with around the world.

3K+Projects Completed
2K+Client Reviews
80+Countries Served
4.9/5Average Rating
5K+Happy Clients
Trusted Across 80+ CountriesUSAUKCanadaGermanyUAEAustraliaS. AfricaMore Reviews →

8+ years of experience · Projects and reviews across Fiverr · Upwork · Kwork

J
James W. CEO, TechFlow USA
US flag USA ✓ Verified
★★★★★

"We have worked with many digital agencies but AI Dev Expert delivered something truly exceptional. Our new WordPress site loads in 1.2 seconds and we are ranking top 3 for all our main keywords within just 5 months. The ROI has been outstanding."

Website + SEO
R
Robert K. COO, MedTech NYC
US flag USA ✓ Verified
★★★★★

"Their technical SEO audit revealed critical issues we never knew existed. After their work, our organic impressions jumped from 12,000 to 140,000 per month in under 6 months. The team is sharp, data-driven and incredibly professional."

Technical SEO
D
David P. Founder, LegalFirst Chicago
US flag USA ✓ Verified
★★★★★

"We were honestly sceptical about AI calling agents but the results proved us completely wrong. Our follow-up rate went from 40% to 95% and we converted 28% more of our pipeline last quarter. Game-changer for our firm."

AI Calling
H
Hannah C. Owner, OrganicBox Seattle
US flag USA ✓ Verified
★★★★★

"Our Instagram Ads ROAS went from 1.8x to 6.2x after AI Dev Expert took over the account. They spend more time on strategy than most agencies spend on delivery. Absolutely outstanding results every single month."

Instagram Ads
V
Victoria A. Founder, ArtHouse NYC
US flag USA ✓ Verified
★★★★★

"Five stars from start to finish. The website, the logo, the social templates — everything works as one cohesive brand system. Our studio bookings increased 240% in the first quarter after launch. Could not be happier."

Full Package
W
William T. CEO, Atlantic Law Boston
US flag USA ✓ Verified
★★★★★

"Legal marketing done properly for the very first time. They understood our compliance requirements and built a lead generation machine that delivers 15 to 20 qualified enquiries every single week, consistently."

Legal SEO+Web
Z
Zachary M. Director, FinanceHub Dallas
US flag USA ✓ Verified
★★★★★

"The custom client portal they built reduced our onboarding time by 70%. Clean code, documented thoroughly, and the support team responded within hours every time we had a question. Highly recommend."

Custom Web App
S
Sarah M. Marketing Director, LuxBrand UK
GB flag UK ✓ Verified
★★★★★

"The AI chatbot they built has reduced our customer service workload by 60% and improved lead conversion by 3x. Absolutely phenomenal work — and the communication throughout the project was flawless."

AI Chatbot
A
Amelia T. Owner, StyleSuite London
GB flag UK ✓ Verified
★★★★★

"From logo design to full brand identity to website launch — everything delivered on time, on budget, and far beyond our expectations. Our brand finally looks as premium as our products deserve."

Brand + Web
C
Charlotte B. Founder, FitLife Manchester
GB flag UK ✓ Verified
★★★★★

"Our blog content strategy delivered 44 page-one Google rankings in just 7 months. The content team understands SEO deeply and writes for both search engines and real human readers. Brilliant."

Content Marketing
F
Fatima K. CEO, SpaMoroccan London
GB flag UK ✓ Verified
★★★★★

"The virtual assistant AI handles all our WhatsApp enquiries and booking confirmations 24/7. We have not lost a single lead to a slow response since going live. It has transformed our business operations."

Virtual Assistant
Y
Yvonne B. Head of Marketing, RetailEdge Leeds
GB flag UK ✓ Verified
★★★★★

"Facebook Ads ROAS improved from 2.1x to 5.8x within 60 days. Their audience research was meticulous and the creatives they produced outperformed everything we had done previously in-house."

Facebook Ads
M
Marcus B. Founder, BrewHouse Berlin
DE flag Germany ✓ Verified
★★★★★

"Our Shopify store redesign led to a 187% increase in conversion rate within the first month after launch. The team truly understood our brand values and our European customer base. Exceptional work."

Shopify Dev
T
Thomas H. CEO, CleanTech Munich
DE flag Germany ✓ Verified
★★★★★

"The custom web application they built handles 10,000 concurrent users with zero downtime. The architecture, code quality, and documentation were all genuinely world-class. An outstanding technical team."

Custom Web App
K
Karl R. Founder, Hamburg Logistics
DE flag Germany ✓ Verified
★★★★★

"Our new website and bilingual SEO strategy successfully opened up the UK market for us alongside Germany. Fully bilingual, GDPR-compliant, and ranking well in both countries within 4 months."

Bilingual SEO+Web
N
Natalie V. Marketing Lead, ParisMode
FR flag France ✓ Verified
★★★★★

"The brand identity rebrand was absolutely flawless — strategic, beautiful, and completely aligned with our luxury market positioning. Delivered in 3 weeks, not the 3 months every other agency quoted us."

Brand Design
L
Laura S. Director, Amsterdam Consulting
NL flag Netherlands ✓ Verified
★★★★★

"The marketing automation workflow they built saves our team 30+ hours every single week. It is seamlessly integrated with HubSpot and our entire sales funnel is now running on autopilot. Incredible."

Marketing Auto
P
Patrick O. CTO, SaaSify Dublin
IE flag Ireland ✓ Verified
★★★★★

"The AI integrations connecting our CRM, email, Slack and analytics were live in 2 weeks and are saving us 25 hours per week in manual data entry alone. The implementation was flawless from day one."

AI Integrations
I
Isabella R. Head of Growth, BarcelonaGrow
ES flag Spain ✓ Verified
★★★★★

"Email automation sequences they built converted 34% of our cold leads into booked discovery calls. That is 3 times our previous rate with absolutely zero additional ad spend on our part."

Email Automation
E
Elena F. CMO, MilanFashion
IT flag Italy ✓ Verified
★★★★★

"Google Ads with our previous agency were simply burning money. AI Dev Expert cut our cost per acquisition by 45% and tripled our ROAS within the first 90 days. The reporting transparency is also excellent."

Google Ads
G
Giorgio M. CEO, RomaEstate
IT flag Italy ✓ Verified
★★★★★

"Our property website now ranks number one for 23 local search terms across Rome. The local SEO strategy was meticulous, and the keyword research they delivered was more thorough than any agency before."

Local SEO
B
Björn L. Director, ScandiSoft Stockholm
SE flag Sweden ✓ Verified
★★★★★

"Speed matters enormously in SaaS and our platform now loads in under 900ms globally after their performance optimisation work. Our churn rate dropped 18% the very next quarter. Measurable, real results."

Performance Opt
O
Olivia N. CMO, ZurichFinance
CH flag Switzerland ✓ Verified
★★★★★

"The data analytics dashboard gives us real-time visibility into customer acquisition cost across every single channel simultaneously. Best marketing investment our company has made in the last three years."

Data Analytics
Q
Quinn A. CEO, SydneyTech
AU flag Australia ✓ Verified
★★★★★

"Working with the AI Dev Expert team remotely was completely seamless. The communication was exceptional, delivery was ahead of schedule, and the WordPress site they built is flawless."

WordPress Dev
X
Xavier D. Founder, MontrealCreative
CA flag Canada ✓ Verified
★★★★★

"The complete rebrand and Squarespace development project was handled brilliantly from discovery to launch. Our new site generates 3x more enquiry form submissions than the old one ever did."

Squarespace Dev
U
Ursula V. Marketing Manager, BruxellesRetail
BE flag Belgium ✓ Verified
★★★★★

"Their on-page SEO and copywriting service transformed our product pages completely. Average session duration doubled and our Google Shopping click-through rate increased by 67% within 8 weeks."

On-Page SEO
Leave Us a Review →

Share your experience with our team.