The Real Cost of Making AI-Generated Code Production-Ready

The Real Cost of Making AI-Generated Code Production-Ready
About two years ago I built an app on Lovable. I knew what I was doing, and I set strict security rules. It was a trial, a lead-capture site. Within about two days of testing, while it was public, I found its Supabase tables were readable by anyone.
No real prospect data was ever exposed. But the app worked, and it still wasn't ready. This post is about that gap: what it costs to make AI-generated code production-ready, and to keep it that way.
I still like building with AI. The agent does the job a lot quicker than a developer. What it won't do on its own is the process that normally comes before coding. So my rule now is less vibe, more structured process.
Now scale that up. Say your AI wrote 300 endpoints in a month. For each one, someone has to decide which of your four roles may call it, and whether it lets a user reach another tenant's data. Then come the cases no demo shows. Two users click Pay at once. A migration runs at 5 pm. Something breaks at 3 a.m. and there are no logs.
The code was cheap to write. Getting it ready to run still costs what it always did, because a person has to decide what "correct" means and sign off on it.
Production-ready AI-generated code is code that has passed a production readiness review. Google's SRE book calls that review "a process that identifies the reliability needs of a service based on its specific details" [P1]. It covers architecture, monitoring, emergency response and capacity, not just security [P1].
Disclosure: yousource publishes this and sells development services. The hours below come from the effort model we built for our own reviews. They're our estimates, not measured delivery data.
Key takeaways
- In the effort model we built for our own reviews, 52 of the 158 first-review hours for a ~50-endpoint app go to work outside the classic security checks.
- Broken access control is #1 in the OWASP Top 10 2025. It was found in some form in 100% of the applications tested [R1].
- OWASP's new 2025 category for mishandled exceptions warns that a missing rollback can let an attacker "send money to the destination multiple times" [P3].
- Supabase leaves indexes to you, and its database backups don't include Storage files [P10, P11].
- France's CNIL fined a software vendor €1.7M for flaws that earlier audit reports had already found [B23].
What a first review actually covers
Your vibe coding MVP looks done asked whether your app is ready. This one asks what getting it ready costs.
Our model splits a first review into 12 modules, A to L. Eleven test the app. K is the report and the retest. This table shows where the hours go for an app of about 50 endpoints and 3–4 roles.
| Area | Modules (first-review hours, mid + senior) | Hours | Share |
|---|---|---|---|
| Security | A automated scans 12 · B access control and RLS 20 · C authentication 12 · D injection 12 · F AI-code checks 10 · G infrastructure 12 | 78 | ≈ 49% |
| Production and data | E business logic and race conditions 12 · H data and privacy 8 · I production readiness (restores, logging, monitoring, incidents) 10 · J architecture and scale 12 · L maintainability 10 | 52 | ≈ 33% |
| Running the review | Kickoff 5 · report 16 · retest 7 | 28 | ≈ 18% |
| Total | 158 |
Security is the biggest block, but it's under half. Stop at a classic security audit of scans, access control, auth, injection and config, and you skip about a third of the work, including the failures that wake you up at 3 a.m.
Why access control grows so fast
OWASP's authorization testing cheat sheet treats access control as a matrix of features, logical roles and, optionally, data [R4]. In a multi-tenant SaaS, the data axis is the one that hurts.
Take the ~50-endpoint app. Fifty endpoints, 4 roles and 2 tenant contexts, yours and another tenant's, make 400 checks. Our model gives module B 20 hours for that, which works out to about 3 minutes a check.
Now go back to the 300 endpoints. That's 2,400 checks. At the same 3 minutes a check, that's about 120 hours for one module.
Broken access control kept the #1 spot in the OWASP Top 10 2025 [R1]. In February 2026, an exam app built on Lovable exposed 18,697 user records [B28]. Its access-control logic was inverted, so unauthenticated users got in [B28].
In April 2026, a flaw in Lovable's own API let an ordinary account reach other users' source code and database credentials "in as few as five API calls" [R8]. When it was reported, it had been open for 48 days [R8].
Supabase's docs say it plainly: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it" [R9]. Mine was the same class of flaw. The AI will happily create the table. Deciding who should read it is still your job. More cases in our vibe coding horror stories.
What breaks in AI-generated code that isn't a vulnerability
The other third covers failures no scanner flags. Lost money, slow pages, silent outages, data you can't get back.
Race conditions
A demo has one user. Production has two people clicking Pay at once. OWASP added "Mishandling of Exceptional Conditions" as a new category for 2025 [P3]. Its example is a funds transfer that's interrupted midway. With no rollback, an attacker can use a race condition to "send money to the destination multiple times" [P3].
I know of no study that measures how often AI code gets transactions wrong. My point is narrower. A prompt that says "add a Pay button" doesn't ask for an idempotency key. Our module E sends up to 20 parallel requests at each money-moving endpoint on staging. It passes only if exactly one succeeds.
Slow queries
Supabase's guide says the first fix for slow row-level security is an index on the policy columns, with "Improvement seen over 100x on large tables" [P8]. That work is yours: "You are responsible for using best-practices to optimize and manage your database: adding indexes" [P10].
Logging and alerts
OWASP's A09 description opens: "Without logging and monitoring, attacks and breaches cannot be detected" [P4]. So at 3 a.m. with no logs, your first alert is a customer's email.
Backups and restores
Supabase recommends that projects on its entry-level plan "regularly export their data" [P11]. Point-in-time recovery is sold as an add-on. And "Database backups do not include objects you store via the Storage API" [P11]. Lovable keeps daily backups for up to roughly 14 days, with no point-in-time restore [P12].
Maintainability
In Stack Overflow's 2025 survey, 66% of developers named "AI solutions that are almost right, but not quite" as their top frustration [P25]. Somebody has to find the "not quite" before your customers do.
Where scanners help, and where they don't
Run a scanner on an AI-built repo and you get a long list, mostly noise. Help Net Security reports that in Ghost Security's study of SAST tools, more than 91% of flagged vulnerabilities were false positives [R16]. Ghost sells into this market, so weigh that.
Scanners also can't tell whether one tenant's admin should export another tenant's invoices. HackerOne said it in 2021: "IDORs can not be detected by tools alone" [R6]. XBOW's Alvaro Muñoz says DAST scanners miss them because "It doesn't know which data belongs to which user" [R18].
So use the tools to shorten the list, then have a person make the calls. See what a code audit should actually check.
Who does the work, and who signs off
This part is my opinion. A trained mid-level developer can run most of the checks. They can send the request as role X against tenant Y, fire the 20 parallel payments and check the alert routing. What they can't do alone is decide the result is acceptable.
Should a billing role see audit logs? Is a four-hour restore good enough? Those are business decisions in technical clothes.
That's why, across the production block in our model, seniors put in 30 of the 52 hours. A senior is the cheapest person who can make those calls and sign them.
How many hours does a year of production-readiness review take?
In our model, a ~50-endpoint app needs about 597 hours of production-readiness review in its first year. That's 350 mid-level and 247 senior. An app of about 100 endpoints needs roughly 900–1,200.
This table shows how the 597 hours add up.
| Work (our estimates) | Mid + senior hours | How often in year 1 |
|---|---|---|
| First review, including retest | 158 (90 + 68) | Once |
| Monthly change review | 26 (16 + 10) | 8 times |
| Quarterly deep review (replaces that month's review) | 77 (44 + 33) | 3 times |
| Year 1 total | 597 (350 + 247) |
The model assumes 5–10 new or changed endpoints a month. It scales the hours 1.5–2×, a range we apply to apps of about 100 endpoints. That's mostly because access control, authentication and input checks all grow with every endpoint.
Why keep reviewing? Because the app keeps changing. OWASP says "most of the problems with authorizations occur because features are added/modified in updated releases" [R4]. It recommends testing "when a new release is created" [R4].
What does making AI-generated code production-ready cost?
At salary cost alone, 900–1,200 review hours a year is roughly $56,000–$75,000 at a US in-house rate. At published Philippine senior engineer salaries, it's $6,600–$18,000.
Here are both baselines.
| Basis (salary only, before overhead) | Hourly | 900–1,200 hours |
|---|---|---|
| US: BLS median, information security analysts, $129,180/yr [R26] | ≈ $62 | ≈ $56k–$75k |
| Philippines: senior software engineer, ≈ $15,300 median base (PayScale) and ≈ $21,100 median total comp (Levels.fyi), up to ≈ $31,500 for the top 10% (PayScale) a year [B32, B33] | ≈ $7–15 | ≈ $6.6k–$18k |
Hourly rates assume 2,080 working hours a year. BLS covers security analysts, not the mix of AppSec and backend engineers this work needs [R26]. A provider adds overhead, QA of the work and margin, so expect a multiple of the offshore line, still far below the in-house one.
The usual alternative is a one-off pentest. TCM Security, which sells them, says web app pentests "can range from $5,000 to $30,000" [R24]. That buys a security snapshot. It won't restore your backup or load-test your database. Put this next to the other running costs of a SaaS.
What skipping it can cost
Coalition's average claim in 2025 was $116,000 [B17].
Regulators punish skipped basics. CNIL fined Nexpublica €1.7M because users could see other people's documents. The vulnerabilities "were known and identified by the company through several audit reports" [B23]. The FTC's 2022 Drizly order binds the CEO personally [B24]. It follows him to any future company that collects data on more than 25,000 people.
Is it too early to bother?
Gold Fig Labs wrote in 2021 that "There is no positive benefit when it comes to security" until customers or regulators force the spend [R31]. The platforms do carry part of the load. Supabase says it "is responsible for Postgres backups and observability" [P10].
But the same docs put indexes, compute sizing and its advisor's fixes on you [P10]. Lovable warns: "Restoring cannot be undone. Any data created or changed after the chosen backup is lost" [P12]. A platform backup is a start. It isn't a tested restore or a schema that scales.
For a prototype with no customer data, I agree with Gold Fig. For a multi-tenant app holding other companies' data, I don't. The Lovable cases above show exposure can land long before product-market fit [B28, R8]. My own trial site was already public when I found my gap.
So don't skip the process that normally comes before coding. If the budget is small, start with three things:
- Run the access-control matrix on every endpoint that touches tenant data. Do it as your own tenant and as another one.
- Do one tested restore, and write down how long it took.
- Turn on error logging, with an alert that a named person actually receives.
How to test AI-generated code covers the rest. If you'd rather hand it over, talk to us about development.
Frequently asked questions
What does production-ready mean for AI-generated code?
It means the app has passed a production readiness review. Google's SRE book calls that "a process that identifies the reliability needs of a service based on its specific details" [P1]. For AI-generated code, it covers access control, race conditions, backups and restores, logging and alerting, architecture and maintainability. Not only security.
How much does it cost to make AI-generated code production-ready?
In the effort model we built for our own reviews, a ~50-endpoint app needs about 597 review hours in year one. A ~100-endpoint app needs roughly 900–1,200. At salary cost only, that's about $56,000–$75,000 at the US BLS median for security analysts [R26]. At published Philippine salaries for senior engineers, it's $6,600–$18,000 [B32, B33].
Does Supabase or Lovable back up my app for me?
Partly. Supabase says it is responsible for Postgres backups [P10]. But its docs recommend that entry-level projects "regularly export their data". Point-in-time recovery is an add-on, and database backups leave out Storage files [P11]. Lovable keeps daily backups for up to roughly 14 days, with no point-in-time restore [P12].
Can a scanner find broken access control?
Not reliably on its own. HackerOne wrote in 2021 that "IDORs can not be detected by tools alone" [R6]. XBOW's Alvaro Muñoz says DAST scanners miss them because "It doesn't know which data belongs to which user" [R18]. A person has to decide what each role and tenant may do.
What should a production readiness checklist for a vibe-coded app check first?
Start with the access-control matrix on tenant endpoints, because broken access control is #1 in the OWASP Top 10 2025 [R1]. Then run one tested restore. Then make sure error logging alerts a named person. As OWASP notes, "Without logging and monitoring, attacks and breaches cannot be detected" [P4].
Sources
- [R1] OWASP Top 10 2025, A01 Broken Access Control: #1; "100% of the applications tested were found to have some form of broken access control" — https://top10.owasp.org/
2025/ A01_2025-Broken_Access_Control - [R4] OWASP Authorization Testing Automation Cheat Sheet: authorization matrix (feature, logical role, data); "most of the problems with authorizations occur because features are added/modified in updated releases"; test "when a new release is created" — https://cheatsheetseries.owasp.org/
cheatsheets/ Authorization_Testing_Automation_Cheat_Sheet.html - [R6] HackerOne, 2 Apr 2021: "IDORs can not be detected by tools alone" — https://hackerone.com/
blog/ rise-idor - [R8] The Next Web, 21 Apr 2026: Lovable BOLA, other users' source code and database credentials "in as few as five API calls"; open 48 days as of reporting — https://thenextweb.com/
news/ lovable-vibe-coding-security-crisis-exposed - [R9] Supabase docs, row-level security: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it" — https://supabase.com/
docs/ guides/ database/ postgres/ row-level-security - [R16] Help Net Security, 19 Jun 2025, on Ghost Security's study of ~3,000 repos: "more than 91% of flagged vulnerabilities were false positives" — https://www.helpnetsecurity.com/
2025/ 06/ 19/ traditional-sast-tools/ - [R18] XBOW, 28 May 2026 (Alvaro Muñoz): "It doesn't know which data belongs to which user" — https://xbow.com/
blog/ xbow-finds-idors-high-accuracy-ambiguous-context - [R24] TCM Security (vendor), 2024: web app pentests "can range from $5,000 to $30,000" — https://tcm-sec.com/
how-much-does-a-penetration-test-cost/ - [R26] US BLS Occupational Outlook: information security analysts median annual wage $129,180, May 2025 — https://www.bls.gov/
ooh/ computer-and-information-technology/ information-security-analysts.htm - [R31] Gold Fig Labs, 24 Feb 2021: "There is no positive benefit when it comes to security"; invest when forced by customers or regulation — https://dev.to/
goldfiglabs/ when-should-my-startup-prioritize-infosec-10e8 - [B17] Coalition 2026 Cyber Claims Report, 5 Mar 2026: average claim $116,000 — https://www.coalitioninc.com/
announcements/ 2026-cyber-claims-report - [B23] CNIL, 24 Dec 2025: NEXPUBLICA FRANCE fined €1.7M; users could see third parties' documents; vulnerabilities "were known and identified by the company through several audit reports" — https://cnil.fr/
en/ data-security-nexpublica-france-fined-eur1700000 - [B24] FTC, 24 Oct 2022: Drizly order binds CEO James Cory Rellas personally, follows him to future companies collecting data on 25,000+ people — https://ftc.gov/
news-events/ news/ press-releases/ 2022/ 10/ ftc-takes-action-against-drizly-its-ceo-james-cory-rellas-security-failures-exposed-data-25-million - [B28] The Register, 27 Feb 2026: Lovable-built exam app, Supabase backend, flawed access-control logic let unauthenticated users in, 18,697 user records exposed — https://www.theregister.com/
2026/ 02/ 27/ lovable_app_vulnerabilities - [B32] PayScale, Senior Software Engineer (Philippines): average base ₱972,096/yr (≈ $15,300 at BSP Nov 2026 average ₱63.541/USD); 90th percentile ₱2m/yr (≈ $31,500) — https://payscale.com/
research/ PH/ Job=Senior_Software_Engineer/ Salary - [B33] Levels.fyi, Senior Software Engineer (Philippines): median total comp ₱1.34M/yr (≈ $21,100) — https://www.levels.fyi/
t/ software-engineer/ levels/ senior/ locations/ philippines - [P1] Google SRE book, Ch. 32: a Production Readiness Review is "a process that identifies the reliability needs of a service based on its specific details"; covers architecture and dependencies, monitoring, emergency response, capacity — https://sre.google/
sre-book/ evolving-sre-engagement-model/ - [P3] OWASP Top 10:2025, A10: "Mishandling of Exceptional Conditions is a new category for 2025"; funds-transfer example, race condition to "send money to the destination multiple times" — https://top10.owasp.org/
2025/ A10_2025-Mishandling_of_Exceptional_Conditions - [P4] OWASP Top 10:2025, A09: "Without logging and monitoring, attacks and breaches cannot be detected". — https://top10.owasp.org/
2025/ A09_2025-Security_Logging_and_Alerting_Failures - [P8] Supabase RLS troubleshooting guide: index RLS columns, "Improvement seen over 100x on large tables" — https://supabase.com/
docs/ guides/ troubleshooting/ rls-performance-and-best-practices-Z5Jjwv - [P10] Supabase Shared Responsibility Model: "You are responsible for using best-practices to optimize and manage your database: adding indexes"; compute and advisor fixes are the customer's; Supabase "is responsible for Postgres backups and observability" — https://supabase.com/
docs/ guides/ deployment/ shared-responsibility-model - [P11] Supabase backups: entry-level projects told to "regularly export their data"; PITR a paid add-on; "Database backups do not include objects you store via the Storage API" — https://supabase.com/
docs/ guides/ platform/ backups - [P12] Lovable docs, database backups: daily, up to roughly 14 days, no point-in-time restore; "Restoring cannot be undone. Any data created or changed after the chosen backup is lost." — https://docs.lovable.dev/
features/ database-backups - [P25] Stack Overflow 2025 Developer Survey: "AI solutions that are almost right, but not quite" top frustration, 66% — https://survey.stackoverflow.co/
2025/ ai