Skip to content
Architecture Checklist Last verified

Fixing AI-Generated Apps Before Launch

2026 production-hardening checklist for founders moving Cursor, Lovable, Bolt, v0 or Replit prototypes to real users, covering RLS, secrets and payments.

Written by Sahil Langoo (Co-Founder & Full-Stack Systems Engineer) · Published

Current starting prices

Prices and delivery estimates, reviewed 21 November 2026.

INR starting prices
Service Starting price Typical timing
Landing page ₹9,999 one-off 1 to 2 weeks
Business website ₹24,999 one-off 3 to 5 weeks
Website maintenance ₹5,000 / month Starts after a review of your site
Custom software ₹80,000 one-off Given with your estimate
USD starting prices
Service Starting price Typical timing
Landing Page $750 one-off 1 to 2 weeks
Marketing Website $1,800 one-off 3 to 5 weeks
Custom Web App / MVP $4,000 one-off 4 to 8 weeks
Engineering Retainer $750 / month Monthly retainer

AI coding tools such as Lovable, Bolt, v0, Replit Agent, and Cursor can take an idea to an 80% working demo in a weekend. The trap is assuming that the last 20% is just polish.

AI models optimize for making the happy path work. They do not model attackers, concurrent users, failed payments, or schema migrations. In 2026 security audits of vibe-coded apps, the same five failure classes show up repeatedly, and most of them are invisible while you are clicking through your own demo.

Use this checklist before putting real user data or payment cards through an AI-built app.


1. Access Control & Data Isolation (The #1 Breach Vector)

Broken access control is the fastest way a prototype turns into a data leak. Never trust hidden UI buttons as security.

  • Verify Row-Level Security (RLS) on every table: If you use Supabase, AI tools routinely create tables without enabling RLS, or write overly broad auth.uid() IS NOT NULL policies that let any logged-in user read everyone else’s rows. Enforce scoped SELECT, INSERT, UPDATE, and DELETE policies tied directly to record ownership.
  • Run the two-account IDOR test: Log in as User A, copy the ID of a private record (an invoice, project, or profile), then log in as User B and send a direct request to that URL or API endpoint. If User B can read or mutate User A’s data, authorization is broken.
  • Enforce permissions on the server: Every API route, Server Action, and RPC must re-verify the active session and user role on the server. Never trust a userId or isAdmin flag passed from the browser.
  • Stop returning SELECT *: AI-generated queries often return full database rows to the client, leaking internal IDs, emails, or metadata into browser network tabs. Explicitly project only the fields the UI needs.

2. Secrets, Bundles & Git History

A leaked API key on a public site gets scraped and abused within minutes.

  • Audit your built JavaScript bundle: Inspect the compiled client files in production and search for sk_, service_role, secret, postgres://, and AI provider keys. Never prefix a private key with NEXT_PUBLIC_ or PUBLIC_.
  • Separate public keys from secret keys: A Supabase anon / publishable key is designed for the browser only when RLS is locked down. A service_role key bypasses every database policy and must live strictly in server-only environment variables.
  • Scrub and rotate leaked Git history: Deleting a hardcoded key in a new commit does not remove it from Git history. Enable GitHub secret scanning and immediately rotate any key that was ever committed or pasted into a public chat.
  • Disable public source maps in production: Unless you intentionally ship open-source client code, prevent production builds from exposing .map files publicly.

3. Authentication, Rate Limiting & AI Spend Caps

  • Replace custom AI-written auth: Never run hand-rolled password hashing, custom JWT localStorage schemes, or homegrown session logic generated from a prompt. Standardize on battle-tested auth (such as Better Auth, Auth.js, Clerk, or Supabase Auth) with HttpOnly, SameSite cookies, email verification, and proper session expiry.
  • Lock down admin signup paths: Confirm that a standard signup request cannot pass role: "admin" in the payload to escalate privileges.
  • Rate-limit auth and expensive routes: Add rate limiting (e.g., via Cloudflare or server middleware) on login, password reset, OTP, and form endpoints to block brute-force attacks.
  • Cap third-party LLM and API bills: If your app calls OpenAI, Gemini, Anthropic, or paid SMS or email APIs, enforce per-user quotas on the server and set hard monthly spend limits in the provider dashboard so one bot loop cannot drain your card overnight.

4. Payments, Webhooks & Idempotency

Demo checkouts work when you enter a test card once and wait on the success screen. Production breaks on retries, closed tabs, and race conditions.

  • Verify webhook signatures on the server: Never unlock paid features solely because the browser landed on /payment-success. Fulfill orders and subscriptions only after verifying the cryptographic signature on Stripe or Razorpay webhooks.
  • Make webhooks idempotent: Payment gateways retry webhooks if your server responds slowly. Store processed event IDs so a retried webhook never double-provisions credits, sends duplicate invoices, or corrupts subscription state.
  • Test the ugly paths: Explicitly test failed cards, cancelled renewals, partial refunds, and a user clicking “Pay” twice on a slow mobile connection.

5. Database, Observability & Deployment Hygiene

A prototype tested by one founder with 10 rows behaves nothing like 100 concurrent users.

  • Move to versioned schema migrations: Stop editing production tables manually in a web dashboard. Track every schema change in code (using Drizzle ORM, Prisma, or SQL migration files) so staging and production stay identical.
  • Configure automated backups and test one restore: A backup you have never restored is a guess, not a recovery plan.
  • Fix obvious N+1 queries and add indexes: Add database indexes on foreign keys and frequently filtered columns (user_id, status, created_at) before traffic hits.
  • Add server-side error tracking and a staging environment: Wire up Sentry (or equivalent) with structured logs that never print passwords or tokens, and deploy changes to a staging URL before pushing to live customers.

Harden vs. Rebuild: How to Decide Without Wasting Budget

Before spending weeks patching prompts, evaluate the codebase honestly:

Signal in Your Current Repo Harden & Launch Clean Rebuild
Database schema Clean tables, clear ownership keys Tangled JSON blobs, duplicated fields, no foreign keys
Where business logic lives Isolated in API routes / server modules Scattered across React useEffect hooks and client components
Bug regression rate Fixing one issue stays fixed Fixing one bug breaks two unrelated screens
Stack & dependencies Standard Next.js / Astro / Postgres / Drizzle Bloated, outdated, or hallucinated packages with broken lockfiles
Best next step 1 to 2 week security & architecture hardening sprint Extract the validated UX, rebuild the backend cleanly

Need a Senior Engineer to Audit Your Repo?

At SquadCoders, we help founders turn fragile AI prototypes into maintainable, production-ready software with clean TypeScript, locked-down databases, and 100% source-code ownership on your GitHub account.

We review your codebase first and tell you directly whether hardening it or rebuilding the core costs less.

Next step

Ready to scope this for your business?

Review the related service scope or check starting prices before sending your brief.

Questions and answers

Common follow-up questions

Is an AI-generated app safe to launch to paying customers?
Not out of the box. The risk is not that an AI wrote the code, but that nobody audited the failure paths the demo never tested, such as User B reading User A's records, forged payment callbacks, exposed service keys, or runaway API bills. Once hardened by a senior engineer, it can run safely in production.
Should I harden my Lovable or Cursor prototype or rebuild it from scratch?
Harden it if the core data model is sound and the gaps are isolated to auth, Row-Level Security, webhooks, and deployment hygiene. Rebuild if the database schema is tangled, business logic lives inside frontend components, or fixing one bug breaks three unrelated screens.
How much does it cost to take a vibe-coded MVP to production?
Custom software and production-hardening estimates depend on whether we are auditing an existing repo or rebuilding the backend. See the current starting prices in the summary above.
Can automated security scanners catch all vulnerabilities in AI-generated code?
No. Automated URL scanners catch missing HTTP headers and leaked frontend keys, but they cannot verify business-logic authorization, such as whether your API checks ownership before updating a record or whether a Stripe or Razorpay webhook handles duplicate events safely.