Kaprin
All insightsFDE Field Notes

How to Harden a Vibe-Coded MVP in Six Weeks

By Kaprin Engineering 7 min read

This playbook is for founders, CTOs and product owners with a working prototype, often built with an AI coding assistant, that now has to take real customers and real money. The demo works. You want to know what stands between it and production, and in what order to deal with it.

Vibe coding means building software by prompting an AI assistant and accepting the generated code with little review. We practice forward deployed engineering (FDE), where senior engineers embed in your team and work in your repository, and the plan below is how we approach a rescue. Treat the week split as a template to adapt, since every codebase differs.

What does it take to harden a vibe-coded MVP?

Hardening means closing the gaps between a prototype and a system that can run unattended: security, state management, concurrency, validation, tests and visibility. Do it in order, starting with an audit, because exposed secrets and missing access control matter more than slow pages or ugly code.

The failures we see are consistent, and our post on the 5 failure modes of vibe-coded software in production describes them in detail. The companion idea, that the model should sit inside a deterministic scaffold, is in Anti-Vibe-Coding. This post is the schedule that turns those ideas into work.

What is the week-by-week plan?

The plan runs audit, then security and state, then concurrency and validation with an eval suite, then observability, load test and handoff. Each phase makes the next one safer: you can't test concurrency sensibly on a database that leaks, and you can't trust a load test without logging to read it.

WeekFocusMain workExit criterion
1AuditMap data flows, review security, inventory spend and dependencies, read the codeA written risk register with each item ranked, and a harden-or-rewrite decision
2-3Security and stateRotate and remove secrets, add authentication and access control, fix the data model, add migrations and backupsNo exposed secrets, every endpoint has an access rule, schema changes are versioned
4-5Concurrency, validation, evalsAdd idempotency and locks, validate all inputs and model outputs, build the eval suite, cap spendDuplicate and racing requests are tested, evals run in CI, spend limits enforced
6Observability, load test, handoffStructured logs, alerts, tracing, load test at realistic volume, runbook and walkthroughYour team can deploy, monitor and roll back without us

Week 1: How do you audit a prototype?

Spend the first week reading and mapping, and hold off on fixing. Trace every path data takes, look for security holes, and add up what the system costs to run. The output is a ranked risk register that decides whether to harden the existing code or rewrite parts of it.

  1. Draw where data enters, where it's stored, which third parties see it and what leaves. Mark personal and financial data.
  2. Search the repository and its history for keys and passwords. Check authentication, authorization, input handling and whether the database is reachable from the public internet.
  3. List model calls, third-party APIs and cloud resources. Find any loops or retries that can multiply cost, and note whether any limit exists.
  4. Find what nobody understands. Code that no person can explain is a risk even when it works.
  5. Feed it the worst real inputs, send the same request twice, and kill a process mid-run to see what state is left behind.
  6. Rank the findings by data and money exposure first, then by likelihood, and agree what's in scope.

Weeks 2-3: What do you fix for security and state?

Fix exposure and data integrity first. Rotate any secret that has ever been in the repository, put access control on every endpoint and table, and give the data model constraints and migrations. None of it is glamorous, and it prevents the incidents that damage trust the most.

  • Move secrets to a secret manager, rotate anything exposed, and add secret scanning to the build.
  • Require authentication on every route, and enforce authorization in the database as well as the interface, for example with row-level security.
  • Replace ad hoc tables with a deliberate schema: types, foreign keys, unique constraints and non-null rules.
  • Introduce versioned migrations, automated backups and a tested restore.
  • Remove state held in memory or on a single machine, since it disappears on restart or deploy.
  • Deploy into your own cloud account or private VPC, with least-privilege access for services.

Weeks 4-5: How do you add concurrency control, validation and evals?

Make repeated and simultaneous events safe, then treat everything the model produces as untrusted input. Add idempotency keys and atomic locks, validate against schemas and business rules, cap spend, and build an eval suite so every later change can be measured.

The code patterns are in our reference post on idempotency keys, atomic locks and audit ledgers. In outline:

  • Every action that changes something carries an idempotency key, so retries and duplicate webhooks do nothing the second time.
  • Shared counters and inventory use atomic operations, such as database row locks or a Redis Lua script.
  • Model output gets parsed against a schema and checked against business rules, and failures go to a human review queue.
  • Per-run and per-day spend limits keep a loop or a bad night from becoming a large invoice.
  • The eval suite starts from real inputs, including the ugliest ones, adds adversarial cases, defines expected outcomes, and runs in CI before each release.

Build the eval set from real data. A June 2026 VentureBeat survey of 157 respondents found that about half had shipped an agent that passed evals and then failed a customer. That's a small sample, but a fair warning that evals only help if they resemble production.

Week 6: What do observability, load testing and handoff involve?

The final week makes the system visible and hands it over. Add logs, traces and alerts, load test at the volume you expect plus a margin, then hand over a runbook and a walkthrough so your team runs it. A system nobody can see or operate isn't finished.

  • Structured logs carry a trace ID per run, error alerts go to a named owner, and dashboards show failures, latency and spend.
  • Load test by replaying realistic traffic, including bursts and duplicate events, and watch for rate limits, queue growth and database contention. Fix what you find, then repeat.
  • Failure drills come next: take a dependency down on purpose, and confirm the system degrades as designed and the alerts fire.
  • Handoff means a runbook, a recorded walkthrough, architecture notes, and a deployment and rollback procedure your team has performed once.

At Kaprin you own 100% of the code, database and IP, deployed in your cloud, and we plan the handoff from day one. Our process runs scope within 24 hours, embed on day 1, harden in weeks 2-6, and hand off by day 45. For a worked example of a prototype-style workflow made reliable, see Slender Morris.

What goes on the audit checklist?

Use this checklist in week 1, or before you commit to any hardening scope. It covers the areas where vibe-coded systems fail most often, and each unchecked item goes on the risk register.

  • No secrets in the repository, its history, or the frontend bundle.
  • Every endpoint requires authentication, and access rules exist per user or tenant.
  • The database is not exposed to the public internet, and backups have been restored at least once.
  • The schema has types, constraints and versioned migrations.
  • Duplicate and simultaneous requests have been tested and produce one result.
  • All inputs, including model output, are validated before they are stored or acted on.
  • Spend limits exist for model calls and paid APIs.
  • Rate limits and timeouts on dependencies are handled, with backoff and circuit breakers.
  • An eval or regression suite built from real inputs runs before release.
  • Logs, traces and alerts exist, and one person owns them.
  • A deployment and rollback procedure is written down and has been run.
  • At least one person on your team can explain how the core flow works.

If you'd like this audit run against your own prototype, our prototype-to-production hardening work starts with exactly that week-1 review. You can also read why enterprise AI pilots fail on Monday morning, or contact us to talk through your own MVP.

Questions readers ask

What is vibe coding?

Vibe coding is building software by describing what you want to an AI coding assistant and accepting the generated code with little or no line-by-line review. It is fast and useful for prototypes, and it tends to skip the unglamorous parts that production needs, such as security, concurrency and monitoring.

Can a vibe-coded MVP be hardened, or should we rewrite it?

Often it can be hardened, especially when the product logic is sound and the weak points are security, state and error handling. A rewrite makes sense when the data model is wrong or nobody can understand the code. The week-1 audit exists to make that call with evidence.

How long does it take to take a prototype to production?

Plan on about six weeks for a contained application, and treat that as a template, since scope and code quality vary. At Kaprin, production deployment is typically within 30-45 days of starting. A prototype that touches many systems or has no tests will take longer.

What should we fix first in a vibe-coded app?

Fix anything that exposes data or money first: exposed secrets, missing access control, unauthenticated endpoints and unlimited spend. After that comes state and concurrency, then validation, then visibility. Speed and polish come last.

Do we need an eval suite for hardening?

For any product that calls a language model, yes. An eval suite is a set of real and adversarial inputs with expected outcomes that runs before every release. Without one you cannot tell whether a fix, a prompt change or a model update made the system better or worse.

Bring us the broken prototype, the SaaS bill, or the manual process

Tell us what is stuck. We reply within 24 hours with a scoped plan, a fixed timeline and the one number we will move.

More insights

FDE = forward deployed engineering. Strict NDA protection. Senior architect review.