Skip to main content
AI, Vibe Coding & the Future of SaaS

Running a Vibe-Coded App in Production: Maintenance, Scaling and Security Risks

By Obaid Tariq, Founder & Lead Engineer · Published

Disclosure: AI Dev Planner rescues and rebuilds vibe-coded apps, so we have an interest in this question. We say where you can do the work yourself and where a rebuild isn't needed. See our disclosure policy.

The short answer

A vibe-coded app in production needs the same things as any other production software: version control, separate environments, backups, tests on the paths that matter, monitoring, and correct access control. Stabilise before you scale: stop adding features for a few weeks, find out what the code actually does, close the security gaps, then improve the structure step by step. The biggest risks in AI-generated code are not exotic; they are missing authorisation checks, exposed secrets, invented dependencies and unhandled edge cases.

How do you maintain and scale a vibe-coded product once real users arrive?

Pause new features, put the code under version control with separate environments and working backups, then add monitoring and tests around sign-up, payments and data access. Fix the security basics next, and only then refactor and optimise, one area at a time, based on what monitoring tells you. Most vibe-coded apps don't need a rewrite; they need the missing engineering around them.

Why the first real users change everything

A prototype only has to work when you click through it. A production app has to work when a hundred people do unexpected things at once, when a payment fails, when someone pastes an emoji into a name field, and when you change one screen without breaking three others. Vibe-coded apps tend to look finished long before they are, because AI tools are good at producing the happy path and poor at telling you what they left out.

The good news is that the fixes are well understood. The order matters more than the techniques.

Phase 1: Stabilise (first one to two weeks)

  1. Freeze features. Every new feature added to an unstable codebase makes the next fix harder. Tell users you are improving reliability; most will be glad.
  2. Get everything into Git with a single main branch, and stop editing code directly on the server or in a hosted builder without committing it.
  3. Separate environments. At minimum a development or preview environment and production, each with its own database and keys, so testing never touches real customer data.
  4. Check backups now, not later. Find out exactly what your provider backs up. Supabase's documentation, for example, says Pro, Team and Enterprise projects get automatic daily backups (retained for 7, 14 and up to 30 days respectively) and recommends that free-plan projects regularly export their data themselves. Then do a test restore.
  5. Move secrets out of the code into environment variables, and rotate any key that has ever been committed or pasted into a prompt.
  6. Write down what exists. A one-page map of the main features, data tables, third-party services and who has admin access. AI tools can help draft this from the code, but check it by hand.

Phase 2: Make problems visible (weeks two to four)

  • Error tracking on both the front end and the server, so you hear about crashes before users email you.
  • Uptime checks on the home page, the login and one key API route.
  • Structured logs for sign-in, payment and permission events, with no passwords or personal data in them.
  • Tests around the money and the data. You don't need full coverage. Start with end-to-end tests for sign-up, login, the core action users pay for, and checkout, plus tests proving one user cannot read another user's data.
  • Continuous integration that runs those tests and a type check on every change before it reaches production. Our guide to a modern web development workflow shows how this fits together.

Phase 3: Pay down technical debt deliberately

Vibe-coded apps often contain the same logic written three different ways, because each prompt produced a fresh solution. Refactor in small, tested steps: consolidate duplicated data-access code first, then shared validation, then UI components. Resist the urge to rewrite everything in a new framework; a rewrite throws away the bug fixes hidden in the current code and usually takes longer than expected.

Phase 4: Scale where the data says to

Most early apps hit database limits before anything else. Look at your slowest queries and add indexes for the columns you filter and join on. If you use Supabase row-level security, its documentation advises adding an index on every column your policies filter on, and wrapping helper calls such as auth.uid() in a select so Postgres evaluates them once per statement rather than once per row. Move slow work such as emails, imports and AI calls into background jobs, and cache pages that don't change per user. For the wider picture, see our guide to scalable web application architecture.

A stabilisation plan for a vibe-coded app with its first real users
PhaseMain goalDone when
1. StabiliseStop things getting worseCode in Git, separate environments, a tested restore, no secrets in code
2. Make problems visibleKnow when something breaksError tracking, uptime checks and CI tests on critical paths
3. Pay down debtMake changes safe and cheapDuplicated logic consolidated; each change ships with a test
4. ScaleHandle more users without slowing downSlow queries indexed, background jobs in place, load is measured

Using AI to maintain AI-written code

AI coding tools are useful in every phase, as long as a person stays responsible for the result. Anthropic's Claude Code documentation recommends giving the agent a check it can run, such as tests, a build or a screenshot comparison, and separating exploration and planning from implementation. In practice: ask the agent to explain a module before changing it, ask for a plan, review the plan, then have it make the change with tests and show you the test output. A second review in a fresh session catches more than the session that wrote the code.

When a rebuild really is the right call

Occasionally the honest answer is to rebuild: when the data model is fundamentally wrong for the product, when the app is locked inside a builder you cannot export from, or when every fix breaks something else and there are no tests to tell you what. Even then, keep the current app running and migrate in stages rather than switching over in one weekend.

What are the biggest risks of shipping pure AI-generated code, including security, architecture and edge cases?

The biggest risk is broken access control: code that works but lets users see or change data that isn't theirs. Close behind are exposed secrets, misconfigured databases, dependencies the AI invented or picked carelessly, unhandled errors and edge cases, and an architecture nobody understands. None of these are unique to AI, but unreviewed AI code produces them quickly and confidently.

Why AI-generated code fails in predictable ways

AI coding tools generate code that satisfies the request in front of them. If the request is "show the user's invoices", the code will show invoices; whether it checks that they belong to the person asking depends on whether anyone thought to say so. The Stack Overflow Developer Survey 2025 found that 66% of respondents named "AI solutions that are almost right, but not quite" as a frustration with AI tools. In production, "almost right" usually means right for the demo and wrong for the edge case.

Security risks, mapped to the OWASP Top 10

The OWASP Top 10 is the most widely used list of web application security risks. The current edition at the time of writing is the OWASP Top 10:2025. The categories below are, in our view, the most relevant to AI-generated apps; the mapping is our own; the mapping of typical failures to categories is our own.

Common failures in AI-generated web apps and the OWASP Top 10:2025 category they fall under
OWASP Top 10:2025 categoryTypical failure in AI-generated codeWhat to check
A01 Broken Access ControlAPI routes or database queries that don't check the record belongs to the current user or tenantTry to read another user's record by changing an ID; write a test for it
A02 Security MisconfigurationDatabase tables exposed to the public API without row-level security; debug mode on; permissive CORSReview every table and environment setting before launch
A03 Software Supply Chain FailuresPackages that don't exist, are abandoned, or are pulled in for one small functionCheck every dependency is real, maintained and needed; enable dependency alerts
A04 Cryptographic FailuresHome-made encryption or token signing; secrets stored in plain text instead of a proven library or auth providerUse your framework's or provider's authentication, not custom crypto
A05 InjectionSQL or HTML built by string concatenationUse parameterised queries and the framework's escaping
A07 Authentication FailuresNo rate limiting on login, weak password reset flows, sessions that never expireTest reset links, lockouts and session expiry
A09 Security Logging and Alerting FailuresNo record of who did what; nobody alerted on failuresLog sign-in, permission and payment events
A10 Mishandling of Exceptional ConditionsErrors swallowed or shown to users with stack traces; failed payments treated as successTest what happens when each external call fails

The database mistake behind many incidents

Many vibe-coded apps use a backend-as-a-service such as Supabase, where the browser talks to the database through an API. That is safe only if access rules are enforced in the database. Supabase's documentation says to enable row-level security on every table in an exposed schema, and notes that once it is on, no data is reachable with the publishable key until you write policies. It also warns that a policy like to anon using ( true ) gives every unauthenticated visitor read access, and that secret keys bypass row-level security and must never be used in the browser. An AI tool asked to "make the error go away" can easily loosen a policy or swap in a secret key, and the app will appear to work perfectly.

Invented and careless dependencies

Language models sometimes recommend packages that don't exist. A study presented at USENIX Security 2025 (Spracklen and colleagues) generated 576,000 code samples with 16 models and found an average hallucinated-package rate of at least 5.2% for commercial models and 21.7% for open-source models. The risk is that an attacker publishes a malicious package under a commonly invented name. Before installing anything an AI suggests, check the package exists, has a real maintainer and history, and is actually needed.

If your app itself calls an AI model

Apps that pass user input to a language model add a separate class of risk. The OWASP Top 10 for LLM Applications 2025 lists prompt injection first (LLM01), followed by risks such as sensitive information disclosure, improper output handling and excessive agency. In plain terms: treat model output as untrusted input, never let it run commands or queries directly, and limit what tools an AI feature can use. Our guide to LLM integration patterns covers safer designs.

Architecture and maintainability risks

  • No single source of truth. Business rules repeated in several places, each slightly different, so fixing one bug leaves others.
  • Logic in the wrong layer. Prices, permissions or limits checked only in the browser, where users can change them.
  • A data model built for the first screen. Missing tenant or organisation IDs, no audit fields, and no migrations history. See multi-tenant SaaS architecture if you serve teams or companies.
  • Nobody understands it. If the only way to change the code is to ask the AI again, every change is a gamble.

Edge cases AI tools routinely miss

  • Two users editing the same record at the same time.
  • A webhook arriving twice, or out of order.
  • Time zones, daylight saving and date-only values.
  • Empty states, very long inputs and non-Latin characters.
  • A third-party API timing out or returning an error.
  • A user deleting their account while a background job is running for them.

A practical review process

  1. Use the OWASP Application Security Verification Standard (ASVS) as a checklist. The latest stable version at the time of writing is 5.0.0, dated May 2025; you don't need every requirement, but the access control, authentication and data protection sections are a good start.
  2. Turn on secret scanning and dependency alerts. GitHub's push protection blocks hardcoded credentials before they reach the repository, and Dependabot security updates open pull requests for vulnerable dependencies.
  3. Write tests that prove users can't reach each other's data, and run them in CI.
  4. Use AI code review as a second pair of eyes, not the only one. A human who understands the data model should approve changes to authentication, permissions and payments.
  5. Read our checklist on custom web application security before you launch.

Frequently asked questions

Is AI-generated code safe to use in production?

It can be, once it has been reviewed, tested and secured like any other code. The risk comes from shipping it unread. Check access control, secrets, dependencies and error handling before real users and data are involved.

Do I need to rewrite my vibe-coded app?

Usually not. Most vibe-coded apps can be stabilised by adding version control, environments, backups, tests, monitoring and proper access control, then refactoring in small steps. A rewrite makes sense when the data model is wrong for the product or the app cannot be exported from the tool that built it.

What is row-level security and why does it matter?

Row-level security is a Postgres feature that lets the database decide which rows each user can read or change. It matters for apps where the browser talks directly to the database, such as many Supabase projects, because without it any visitor with the public key may be able to read data that is not theirs.

Sources

  1. OWASP Top 10:2025 — Current edition and category names (A01 Broken Access Control to A10 Mishandling of Exceptional Conditions). Accessed 19 October 2026.
  2. OWASP Application Security Verification Standard (ASVS) on GitHub — Latest stable version 5.0.0, dated May 2025. Accessed 19 October 2026.
  3. OWASP Top 10 for LLM Applications 2025 — LLM01:2025 Prompt Injection and the other LLM risk categories named. Accessed 19 October 2026.
  4. Supabase Docs: Row Level Security — Enable RLS on every table in an exposed schema; no data via publishable key until policies exist; `to anon using (true)` risk; secret keys bypass RLS and must not be used in the browser; index policy columns; wrap helper calls in select. Accessed 19 October 2026.
  5. Supabase Docs: Database backups — Daily backups on Pro, Team and Enterprise with 7, 14 and up to 30 days retention; free-plan projects advised to export data themselves. Accessed 19 October 2026.
  6. Spracklen et al., "We Have a Package for You!" (USENIX Security 2025) — 16 models, 576,000 code samples, hallucinated-package rates of at least 5.2% (commercial) and 21.7% (open-source). Accessed 19 October 2026.
  7. Stack Overflow Developer Survey 2025: AI — 66% of respondents frustrated by AI solutions that are almost right, but not quite. Accessed 19 October 2026.
  8. Claude Code documentation: Best practices — Give the agent a way to verify its work; explore and plan before implementing; review in a fresh context. Accessed 19 October 2026.
  9. GitHub Docs: About push protection — Push protection blocks hardcoded credentials before they are pushed. Accessed 19 October 2026.
  10. GitHub Docs: About Dependabot security updates — Dependabot opens pull requests to update vulnerable dependencies. Accessed 19 October 2026.

Recommendations without a source are AI Dev Planner’s own engineering opinion. Platform features and prices change; check the linked pages for the current position. Found an error? See our corrections policy.

Users arriving faster than your code can cope?

We review vibe-coded apps, fix access control and security gaps, add tests and monitoring, and tell you honestly whether a rebuild is needed. Start with the free readiness checker, or talk to us directly.