• Agents
  • Pricing
  • Blog
Log in
Get started

Security for apps built with AI. Paste a URL, get a report, fix what matters.

Product

  • How it works
  • What we find
  • Pricing
  • Agents
  • MCP Server
  • CLI
  • GitHub Action

Resources

  • Guides
  • Blog
  • Docs
  • OWASP Top 10
  • Glossary
  • FAQ

Security

  • Supabase Security
  • Next.js Security
  • Lovable Security
  • Cursor Security
  • Bolt Security

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Imprint
© 2026 Flowpatrol. All rights reserved.
Guides

The builder's
field manual.

Everything you need to take your AI-built app from prototype to production. Database, auth, security, domains, AI context — interactive guides with progress tracking, platform-specific instructions, and copy-paste code. Built for people who ship with Lovable, Bolt, Cursor, and Next.js — not security engineers.

Prototype to production
Security hardening
Launch day playbook
AI context mastery
01·Checklist

Before you launch

The single most important thing on this page. Every step takes minutes. Skipping any of them is the difference between a clean weekend and a 3am rotation of every credential you own.

Field manual · Ed. 01

The pre-launch checklist

11 checks that cover every bug class we see in real breaches of AI-built apps. Each one ships with a one-liner you can paste into a terminal or your DevTools to confirm it passes.

0/11
complete
  • 01

    Scrub client code for hardcoded secret keys

    Any `sk_live_*`, `sk-*`, or `AKIA*` key shipping in your bundle will be drained within hours of launch. Anything with "secret" in the name belongs server-side only. Rotate anything you find.

    API key exposure
  • 02

    Keep the Supabase `service_role` key server-side

    service_role bypasses every RLS policy you wrote. It must never appear in a `NEXT_PUBLIC_` variable, a client component, or anywhere shipped to the browser. If it ever has, rotate it now.

    Supabase security playbook
  • 03

    Confirm `.env` has never been committed to git

    Git remembers everything. If a `.env` ever landed in a commit — even one you deleted later — assume every secret it held is public. If the command below returns anything, rotate every credential inside it.

  • 04

    Enable Row Level Security on every Supabase table

    Your Supabase URL and anon key are meant to ship to the browser — RLS is what actually protects the data behind them. Without it, anyone who knows your project URL can query every row. Any `false` in the result below is a wide-open table.

    Supabase RLS playbook
  • 05

    No user input glued into SQL strings

    Every query must use parameter binding — your ORM's placeholders, prepared statements, or the Supabase query builder. Template literals inside `.query()` or `.raw()` with a variable inside are the giveaway.

    SQL injection
  • 06

    Deny by default on every protected route

    Maintain an allowlist of public paths and require a session everywhere else. Pick a logged-in API route, strip the session cookie, and re-request it — if it still returns data, your middleware isn't running where you think it does.

  • 07

    Check ownership on every `/api/{id}` route

    For every endpoint that fetches by ID, the database query must also filter by the authenticated user. Create two accounts, grab an ID as User A, then request it as User B — if the data comes back, you have an IDOR.

    IDOR explained
  • 08

    Turn on email verification before you launch

    Without it, bots flood you with fake accounts within hours of going live. Supabase: Dashboard → Authentication → Settings → enable "Confirm email". Clerk and Auth.js have the equivalent toggle.

  • 09

    Verify Stripe webhook signatures

    Your handler must validate the `Stripe-Signature` header before trusting the payload — otherwise anyone can POST a fake `checkout.session.completed` and unlock paid features for free. If the test below returns 200, the check is missing.

    Stripe webhook walkthrough
  • 10

    Sanitize every `dangerouslySetInnerHTML`

    Every one of these is a potential XSS vector. Grep your codebase, and for each hit either switch to plain-text rendering or pipe the input through DOMPurify first.

    XSS in React
  • 11

    Set security headers and lock down CORS

    Add `Strict-Transport-Security`, `Content-Security-Policy`, `X-Frame-Options`, and `Referrer-Policy` in your hosting config. For authenticated endpoints, replace `Access-Control-Allow-Origin: *` with your real origin.

11 checks to go
02·Playbooks

By platform

The bugs are the same, but every platform ships its own defaults, footguns, and workarounds. Pick yours.

S

Supabase

RLS, anon keys, and the policies your AI never wrote.

68%of Supabase apps ship with broken RLS
L

Lovable

170+ Lovable apps were exposed via the same bug. Here's the fix.

170+apps in the CVE-2025-48757 disclosure
B

Bolt

What Bolt scaffolds, what it skips, and what to add before launch.

7/10OWASP categories Bolt apps fail by default
C

Cursor

Editor-side risks: prompt injection, MCP, and what your IDE can leak.

3classes of editor-side risk to know
N

Next.js

Middleware, server actions, and the bypasses that ship with templates.

CVE-2025-29927middleware bypass — patch yours
M

MCP

Your AI's tool calls are an attack surface. Lock them down.

1 lineis all it took to exfiltrate Postmark inboxes
03·Recipes

Fix the eight most common bugs

You scanned. You found something. Each card is a one-screen fix recipe — what's broken, what to do, and the walkthrough that proves it.

Critical· CWE-862

Fix missing RLS policies

Bug · Tables are exposed via the anon key with no row-level filtering.

Fix · Enable RLS, then write `auth.uid() = user_id` policies for every table.

Walkthrough
Critical· CWE-639

Fix IDOR on API routes

Bug · Routes return any record by ID without ownership checks.

Fix · Add `where user_id = auth.uid()` to every query that takes an ID.

Walkthrough
Critical· CWE-798

Fix exposed API keys

Bug · Service keys, Stripe keys, or OpenAI keys ended up in client bundles.

Fix · Move them to server-only env, rotate them, and re-deploy.

Walkthrough
High· CWE-79

Fix XSS in React

Bug · `dangerouslySetInnerHTML` renders untrusted HTML directly.

Fix · Render as text, or sanitize with DOMPurify before injecting.

Walkthrough
Critical· CWE-89

Fix SQL injection

Bug · String-concatenated SQL queries built from user input.

Fix · Use parameter binding or your ORM's query builder. Never concatenate.

Walkthrough
Critical· CWE-915

Fix signup backdoors

Bug · Mass assignment on signup lets anyone register as admin.

Fix · Allowlist fields on the server. Never spread `req.body` into a user record.

Walkthrough
High

Fix OTP & 2FA bypasses

Bug · OTP verification is client-checked or skippable via response tampering.

Fix · Verify on the server, lock the account state, and rate-limit attempts.

Walkthrough
High

Fix self-upgrade premium bypass

Bug · The "upgrade plan" call accepts the new tier from the client.

Fix · Always derive plan state from your billing provider webhook, never from the request.

Walkthrough
04·Deeper

Go deeper

Reference material, conceptual framing, and longer reads — for when you have a coffee and want to actually understand what you just shipped.

01
Walkthrough60 min

Prototype to production

Database, auth, hosting — every step from demo to deployed. Interactive checklist with platform-specific instructions.

02
Walkthrough30 min

AI context mastery

Project rules, docs, and prompt techniques that make AI ship better code. Templates for Cursor, Claude Code, and Lovable.

03
Reference15 min

OWASP Top 10 for builders

The canonical security list, rewritten for people who ship with Lovable and Bolt.

04
Reference5 min

Security glossary

IDOR, RLS, XSS, SSRF, SQLi — 30+ security terms in plain English.

05
Walkthrough12 min

Same Default, Four Breaches

How the same BaaS default shipped to production in Moltbook, Tea, Cal AI, and Quittr.

06
Concept8 min

AI agent blast radius

What can your agent actually destroy? A framework for thinking about damage.

07
Walkthrough10 min

NPM supply chain hygiene

Lockfiles, audits, and the 39-minute window that mattered. Practical hardening.

08
Concept6 min

Your agent builds apps. Who checks security?

The handoff problem in AI development, and how to close the loop.

05·Questions

Frequently asked

The questions we get most from builders shipping AI-generated apps. Each answer also lives in the page schema so AI search engines can quote it directly.

How do I make my AI-built prototype production ready?

Start with the Prototype to Production guide on this page. The four biggest gaps between a prototype and a production app are: database (migrate off SQLite or in-memory storage to Supabase or Neon), authentication (use a real auth provider instead of custom JWT logic), environment variables (audit every secret, remove any from client-side code), and hosting (deploy to Vercel, Railway, or Netlify with a custom domain). Our step-by-step guide walks through all of these with platform-specific instructions.

How do I secure an app I built with Lovable, Bolt, or Cursor?

Start with the pre-launch checklist on this page, or use the interactive Security Hardening guide. They walk through the checks that catch over 90% of the bugs we find in AI-built apps: enabling Row Level Security on every Supabase table, moving the service_role key off the client, testing for IDOR, verifying API auth enforcement, checking webhook signatures, and setting security headers. Each step links to a deeper guide.

What is Row Level Security in Supabase and why does it matter?

Row Level Security (RLS) is the PostgreSQL feature Supabase uses as its primary access control mechanism. When RLS is enabled on a table, every query is filtered by policies you write — for example "users can only see rows where user_id matches auth.uid()". Without RLS, the anon key (which is meant to be public) gives full read and write access to your entire database. In our scan of 100 vibe-coded apps, 68% of Supabase-backed apps had missing or broken RLS. See the Supabase playbook in the platforms section above for the fix.

Is it safe to expose the Supabase anon key in client-side code?

Yes — but only if Row Level Security is enabled on every table and the policies are correct. The anon key is designed to live in your client JavaScript. Its safety depends entirely on RLS doing its job. The service_role key is the opposite: it bypasses all RLS and must never appear in client code, NEXT_PUBLIC_ environment variables, or your bundled JavaScript.

What is IDOR and how do I fix it?

IDOR (Insecure Direct Object Reference) is the most common bug in AI-generated APIs. It happens when a route like GET /api/orders/{id} returns the order without checking that the authenticated user actually owns it. To fix it, add a where-clause that filters by the current user — for example WHERE user_id = auth.uid() — to every query that takes an ID. The fix recipes section above links to a full walkthrough.

What is the OWASP Top 10 and where does it apply to AI-built apps?

The OWASP Top 10 is the security industry's canonical list of the most critical web application security risks, maintained by the Open Worldwide Application Security Project. It applies one-for-one to AI-built apps — the bugs are exactly the same, AI just ships them faster. We wrote a builder-friendly version at /owasp-top-10 that explains each category in plain English with the actual code your AI ships and how to fix it.

How do I get better code from AI coding tools like Cursor or Lovable?

Create a project rules file (.cursorrules for Cursor, CLAUDE.md for Claude Code, or a prompt preamble for Lovable/Bolt). In it, define your exact tech stack with versions, your folder structure, your security rules (enable RLS, never expose service_role, parameterize queries), and include example code patterns. The AI Context Mastery guide on this page walks through every step with templates you can copy-paste. The biggest single improvement: build features incrementally instead of all at once.

Do I need to be a security engineer to use these guides?

No. These guides are written specifically for builders shipping with AI tools — Lovable, Bolt, Cursor, v0, Replit, Claude — not for security professionals. Every recipe is one screen long, every checklist item takes minutes, and every guide assumes you're a creator or founder, not a penetration tester.

06·Sources

Sources & further reading

Every claim on this page is grounded in standards, official docs, or named CVEs. If you want the source material, here it is.

  • OWASP Top 10:2021
    OWASP Foundation
  • Row Level Security
    Supabase Docs
  • Common Weakness Enumeration (CWE) Top 25
    MITRE
  • Application Security Verification Standard (ASVS)
    OWASP Foundation
  • Secure Software Development Framework (SSDF) — SP 800-218
    NIST
  • CVE-2025-29927 — Next.js Middleware Authorization Bypass
    NVD
  • CVE-2025-48757 — Lovable RLS Misconfiguration
    NVD
  • Web Security Academy
    PortSwigger

Last reviewed and updated 7 April 2026 · Maintained by the Flowpatrol Team

Done reading?

Reading the field manual is half of it. The other half is proving your app actually does what the checklist says. Paste a URL.

Run a free scanSee the OWASP Top 10