Blog post

You inherited a vibe-coded app. Here's a two-week hardening plan

Author

Kirill Karakhainko

Category

Development

Date

Nov 25, 2026

A developer on Hacker News wrote that a new colleague from sales, on their very first introduction, "handed me a vibe coded app and asked me to review it for them and put it into production."

If that's you, the app probably works on the happy path, and it may already have users. It usually has no tests, no backups, no checked access rules and no deploy process. The plan below covers the first two weeks, starting with what can do the most harm.

What you inherit

Most studies of AI-assisted code come from companies that sell code analysis tools. They disagree on a lot, but each found problems that only a careful review would catch. In repositories of Fortune 50 enterprises, Apiiro found that AI-assisted developers made 76% fewer syntax errors and 60% fewer logic bugs, but created 322% more privilege-escalation paths and 153% more architectural design flaws.

Bar chart of Apiiro's findings for AI-assisted code: syntax errors down 76%, privilege escalation paths up 322%, architectural design flaws up 153%, logic bugs down 60%

CodeRabbit compared 470 open-source pull requests and found 1.7 times more issues in the ones co-written by AI, including 75% more logic and correctness issues, the opposite of Apiiro's result. GitClear tracked 211 million changed lines and found four times more code cloning, with copy-pasted lines up from 8.3% to 12.3% between 2021 and 2024. And Google's DORA 2025 report found that AI adoption still has a negative relationship with delivery stability. Its summary is worth keeping in mind: "AI doesn't fix a team; it amplifies what's already there."

None of these studies looked at Lovable or Bolt apps. Developers who have taken those apps over describe the same few gaps.

  • One developer's demo rescue of a fresh Lovable export found "one test, no CI", 306 lint errors, and a schema that existed only as a Drizzle export for Lovable Cloud.

  • In a Hacker News thread about a client who kept vibe-coding, one developer's audit found "anyone having admin access", buyers able to set their own price at checkout, and leaking personal data.

  • Another developer wrote on Hacker News that "it feels like i've joined a new company and been given a legacy codebase to work on, despite it being a week old."

A two-week plan for an inherited app: stop the damage in days 1–2, make it safe in week 1, make it changeable in week 2

Days 1–2: stop the damage

  1. Take ownership of every account. List them all: the code repository, the database (Supabase or Lovable Cloud), hosting, domain, payments, email, and any AI or third-party APIs. Move each one to a company account with at least two admins.

  2. Stop unreviewed changes. Lovable syncs two ways with GitHub, so anything the original builder prompts lands in the code you're fixing. Protect the main branch in GitHub, so Lovable pushes its changes to a separate branch for review, and limit who has editor access in Lovable. Editors can publish, and database and backend changes from a prompt go live as soon as they're accepted, even without publishing.

  3. Back up the data. Free Supabase projects have no automatic backups, and database backups never include files in Storage. Follow Supabase's backup guide, which dumps the live database's roles, schema and data as three separate files, then copy the storage files. On Lovable Cloud, use its database export.

  4. Rotate exposed secrets. Search the browser bundle and the git history, including any committed ".env" file. Rotate third-party keys, such as Stripe or OpenAI, at each provider. For Supabase, creating a new key doesn't revoke the old one. Following its rotation guide, create a new secret key and move every client to it and to a publishable key. Then deactivate the legacy keys, or delete the leaked secret key. If the leaked key was the legacy service role key, also revoke the legacy JWT secret.

  5. Run the Security Advisor. In the Supabase dashboard it flags tables where, in its words, "anyone with your project URL can read, edit, and delete all data". Fix them by writing the access policies and turning on row-level security in the same change: switched on with no policies, it blocks your own app.

Apps on Lovable Cloud come without the Supabase dashboard, the CLI or the API keys, because Lovable Cloud doesn't expose them. Use Lovable's own security checks and database tools until you move to a Supabase project you own.

Week 1: make it safe

  • Every table limits rows to their owner, and every server function checks who's calling. Our pre-launch checklist walks through how to test each one without reading the code.

  • Prices, discounts and admin flags are set and checked on the server, never trusted from the browser.

  • Add an error tracker and alerts on failed payments and sign-ups. Until you can see errors, you're relying on users to report them.

  • Use a second Supabase project for development. Supabase's branching does this automatically, but it isn't on the Free plan, and Free projects pause after a week without activity.

Week 2: make it changeable

  • Get the schema into version control. If the repository has no "supabase/migrations" folder yet, run "supabase init" and "supabase link", then "supabase db pull --remote" to turn the live schema into a migration file. It needs Docker running. From then on, schema changes go through migrations, tested locally with "supabase start".

  • Write tests for how the app behaves today. Michael Feathers calls these characterization tests: tests that pin down what the code actually does, before you change it. Start with sign-up, payment and the app's main action.

  • Run the tests and the linter in CI on every pull request. As Martin Fowler puts it, "Instituting Continuous Integration without self-testing code won't work", so the tests come first.

  • Clean up in small steps: fix lint errors, delete dead code and remove duplicated logic, one pull request at a time, with the tests green after each.

Moving a Lovable Cloud app onto your own infrastructure is a separate project. Lovable doesn't move a project to your own Supabase project in one step, and its database export covers only part of the app:

Part of the app

In the database export

Tables and data

Yes

User accounts and passwords

Yes

Edge function code

No, comes with the code

Secrets and API keys

No, set up again

Sign-in provider settings

No, set up again

Storage files

No, move separately

Check the hosting too. Lovable projects created since May 2026 are TanStack Start apps that need a server to run; older ones build to static files.

When to rebuild instead

After two weeks, this table usually settles it.

Signal

Harden it

Rebuild it

Core flows

Mostly work

Mostly broken

The data model

Fits the product

Wrong at the root

Fixes

Stay fixed

Break something else

Most apps that found users are worth hardening, because the product decisions in them are sound even if the code is rough. Rebuild when the data model is wrong, since almost everything else depends on it. Secret keys in the browser don't decide it either way: rotating them and moving the code that uses them to the server is part of hardening, and a rebuild has to do the same.

If you want a hand

We've hardened apps like this before. We work on a copy, so your users aren't affected, and you get the app back with tests, CI and migrations in place.

Hybrid Intelligence