cd /news/ai-tools/i-built-a-saas-with-lovable-in-one-p… · home › topics › ai-tools › article
[ARTICLE · art-178161] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

I built a SaaS with Lovable in one prompt, then audited it like a paying client would

A developer built a SaaS app with Lovable in a single prompt and then audited it using the same static review process applied to paying clients, finding that an initial automated pass scored the app 0/100 with six critical alerts that were all false positives, while the scanner missed two real issues. The genuine findings were uncapped AI spend on a reminder-email feature callable without per-user quotas, and a Stripe webhook that only downgrades on subscription deletion, letting failed-payment users keep Pro access. After manual verification the app scored 81/100 with zero critical and zero high findings.

recommendation

Treat scanner output as leads, not verdicts: manually verify each alert and add per-user quotas plus subscription-status checks before launching an AI-built app.

more in playbook: Securing agents and AI tools
by read2 min views7 publishedNov 29, 2026

Most "AI-built apps are insecure" posts are based on 2025 data: RLS switched off, service-role keys in the browser, unsigned Stripe webhooks. I wanted to know if that's still true, so I tested it.

/admin page, and an AI button that drafts payment reminder emails. Then I ran the same static review I do for clients: scanners first (my own heuristics, semgrep, gitleaks, trufflehog, osv-scanner), then reading every flagged file and walking a 7-area checklist.

auth.uid(). The invoice insert/update policies even check that the client row belongs to the same user.plan lives in a subscriptions table that users can only read; only the server-side webhook writes it.user_roles table with no insert policy for users, and the admin list is checked on the server. My first automated pass scored the app 0/100 with six "critical" alerts. All six were false alarms. Five came from a rule that expected stripe.webhooks.constructEvent() and didn't recognise a hand-written HMAC check, and it fired once per mention of "stripe". The sixth flagged a committed .env that only holds public values (Supabase URL and publishable key), which Lovable commits by default.

Meanwhile, the scanner missed both real problems. A scan is a set of leads, not a verdict.

1. Uncapped AI spend (Medium). The reminder feature is a createServerFn behind auth middleware, which is good. But any signed-in user can call it as often as they like, with no per-user quota. One script on a free account can drain your AI budget.

export const draftReminder = createServerFn({ method: "POST" })
  .middleware([requireSupabaseAuth])
  .inputValidator(/* invoiceId */)
  .handler(async ({ data, context }) => {
    // ...loads the invoice, then calls the model. No quota check.
  });

Fix: an ai_usage(user_id, day, count) table, incremented in the same call, refusing over a limit (for example 20/day free, 200/day Pro), plus a spend alert.

2. Failed payments keep Pro (Medium). The webhook upgrades on checkout.session.completed and downgrades only on customer.subscription.deleted. When a card fails, Stripe marks the subscription past_due/ unpaid and retries for days or weeks before deleting it. The whole time the user keeps Pro for free, and your database says they're paying.

Fix: handle customer.subscription.updated and keep plan = 'pro' only while the status is active or trialing.

Smaller ones (Low):

pg_advisory_xact_lock fixes it). Final score after manual verification: 81/100: 0 critical, 0 high, 3 medium, 7 low.

The full, unedited report, with file names and line numbers, is here: https://chinh-launch-audit.netlify.app/sample-report.html

I do fixed-price launch-readiness reviews for AI-built apps. If you're about to launch something on Lovable, Bolt or Cursor and want a second pair of eyes, I'm doing a few free quick looks this week (read-only repo access, the 2 biggest risks by email, no call): https://chinh-launch-audit.netlify.app/intake.html?plan=quick

I used AI tools (Claude) to help run the review and draft this post; every finding was verified by reading the code.

── more in #ai-tools 4 stories · sorted by recency
── more on @lovable 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-saas-with-…] indexed:0 read:2min 2026-11-29 · —