AI coding tools have changed the cost of software development. Generating code now costs a fraction of what writing it did, which is why the AI coding ROI conversation usually starts at generation speed. The expensive part moved downstream: getting that code to a state a security team can actually trust.
Jim Manico, founder of Manicode and a long-time OWASP contributor, has a name for what happens in that gap: the security token furnace. Every time AI-generated code isn’t secure on the first pass, it enters an expensive, repetitive loop: generate, fail a security check, patch, retest, and re-verify. This burns tokens, developer time, and review cycles. The headline speed is real. The return on investment is what’s left after the furnace has had its share.
This post maps that full cost and proposes a way to measure it honestly, change by change, so AI investment decisions rest on verified outcomes rather than generation speed.
The data behind the furnace
Veracode’s GenAI Code Security benchmark has tracked the security quality of AI-generated code since 2023, testing more than 100 models across Java, .NET, JavaScript, and Python. The original finding: on average, only 56% of AI-generated code passed security testing. This means roughly 44% of generated code carried a vulnerability such as cross-site scripting, SQL injection, broken crypto, or log injection. Syntax correctness, by contrast, climbed to nearly 100%. The models learned to write code that runs. They didn’t learn to write code that’s safe.
The most recent fall 2026 update shows the first meaningful movement in the series: the average security pass rate rose from 56% to 62%, and the vulnerability rate dropped from roughly 44% to about 38%. That’s real progress, but it’s uneven. The gains concentrate heavily in cross-site scripting (CWE-80), while crypto (CWE-327), SQL injection (CWE-89), and log injection (CWE-117) barely moved. And the top-performing models carry premium compute costs that most organizations won’t realistically default to.
(The webinar discussion referenced throughout this post took place before that fall update and cites the earlier 56% figures. The direction of the argument holds either way: even at 62%, nearly four in ten generated changes still carry a vulnerability.)
1. Map the full cost of an accepted change
The token furnace isn’t one cost. It’s a chain:
Generate → detect → patch → rescan → functional test → human review… with retries at any point where a security or functionality check fails.
Each link in that chain costs something different:
- Tokens. Every retry re-runs the model. Patch generation, re-patching after a failed fix, and agentic review loops all consume compute, and frontier-class models charge frontier-class prices for it.
- Developer time. Triaging findings, writing patch prompts, reviewing AI-proposed fixes, and shepherding changes through approval.
- Regression testing. A security patch can alter behavior. Functional test suites have to run again, and they need real coverage to catch what changed.
- Approvals. In regulated environments, a human has to sign off that the fix is real and the application still works.
The extra cost is everything that happens because the first generation failed. As Chris Wysopal, Veracode’s CTO and co-founder, put it in the webinar: every time an LLM generates a vulnerability, teams have almost lost the benefit of generating the code with an LLM in the first place.
2. A security patch can still break the application
Automated patching sounds like the escape hatch from the furnace. The data says otherwise.
Wysopal cited an analysis of six real-world CVEs — deliberately complex ones — where AI-proposed patches succeeded only 26% of the time. Another 20% patched the vulnerability correctly but changed the application’s functionality. The worst outcome: 54% of the time, the patch simply didn’t fix the problem or introduced a new one.
Manico has lived this. He maintains the OWASP Java HTML Sanitizer, a server-side library that strips dangerous content from submitted HTML so it can render safely. This is the kind of component behind every WYSIWYG editor. When his application hit a sanitizer bypass, he asked AI to fix it. The model saw that the sanitizer was bypassable and “fixed” the problem by escaping all submitted HTML instead of preserving the library’s intended rich-text behavior. The security concern was addressed. The application was broken: authors submitting rich text got a wall of raw HTML on the page.
The patch was, in a narrow sense, correct. It destroyed the feature it was protecting. That’s the failure mode machine-speed patching creates, and it’s why functional testing and human review can’t be optional gates on the way out of the furnace.
3. Measure business expense, not just token spend
Token bills make the furnace visible, but they’re only part of the expense. The priority is reducing the total expense of securing code across diverse workflows, not the line item for tokens.
An engineering leader at a financial-services firm described the workflow overhead that compounds on top of it: overlapping security gates, each triggering its own scan, its own remediation cycle, its own re-verification. What we see here is the same findings chased through multiple tools and multiple review rounds. The point of that account isn’t to argue for removing verification. It’s to argue for measuring it. When remediation work is repetitive and duplicated across gates, that’s cost sitting inside the AI coding ROI budget that nobody has itemized.
The furnace burns more than tokens. It burns review cycles, regression runs, and approval time. Teams that only track token spend are measuring possibly the smallest part of the bill.
4. Match verification depth to risk
Getting out of the furnace doesn’t mean trusting AI-generated code less; it means verifying it efficiently.
The approach that held up across the webinar discussion is hybrid AI plus SAST:
- Repeatable static analysis (SAST) handles the routine checks. It’s deterministic, inexpensive per scan, and reliable at finding the vulnerability classes it’s built for: the kinds that appear in roughly four in ten AI-generated changes. Running it on every change is cheap enough to afford.
- Probabilistic AI adds context and triage. AI-assisted analysis can understand what an application is supposed to do, surface business-logic and authorization issues that pattern-based scanning can’t, and help prioritize which findings actually matter. It can even flag when a requirement itself looks wrong. But it’s probabilistic: the same verification prompt can produce different results run to run, and neither approach finds every flaw.
Neither layer replaces human accountability. The proposal:
- Scan every change with fast, deterministic analysis — quick, inexpensive, and right-sized for the task rather than a heavyweight scan of the entire application on every pull request.
- Run deeper agentic review at a risk-appropriate cadence — less frequently, reserved for higher-risk surfaces, where the deeper context is worth the compute.
- Keep functional tests and required approvals. The 20% functional-breakage rate on AI patches is exactly why both exist.
- Treat AI-assisted fixes as guidance to verify, not fixes to ship. A proposed patch is a starting point for review, not a completed remediation.
The exception worth naming: Veracode Fix. Veracode’s remediation assistant is a security-specialist model trained on curated, human-verified reference patches rather than general-purpose training data. This means its suggested fixes behave more like a tested library than open-ended generation, and they still pass through the same scan-and-verify gate as any other change.
Verification depth should scale with risk, and the total cost of verification should be measured, not assumed.
5. Build a verified-change scorecard
Generation speed is easy to measure and easy to game. What actually determines AI coding ROI is the cost of getting from generation to a change that’s verified secure and functionally intact. Five measures (proposed here as a starting framework, not a benchmark) capture that:
- First-pass security success: the share of AI-generated changes that clear security scanning without remediation. This is the single number that determines whether the furnace runs at all.
- Retries per accepted fix: how many patch-and-rescan cycles an accepted change consumes on average. High retry counts mean remediation, not development, is driving token spend.
- Human review time: minutes of security and code review per accepted change. This is the expensive, slow link in the chain and the one most often left out of ROI models.
- Functional regressions: how often an accepted change breaks existing behavior. A security fix that breaks the application isn’t a fix.
- Total cost per verified change: tokens, developer time, regression testing, and approvals, summed per change that actually ships. This is the number that makes AI investment comparable across teams, tools, and models.
Track these per repository and per workflow. This scorecard will tell you where the furnace is burning and whether the money spent on AI coding is producing verified, shippable software.
Start with a baseline, not a rule change
The temptation after seeing data like this is to change something immediately, like tighten the prompts, add a gate, swap models. The better first move is cheaper and more revealing:
Assess one repository’s full generation-to-approval workflow and establish a baseline (generation volume, security findings, retries, review time, and cost per verified change) before changing its rules or review cadence.
Without a baseline, there’s no way to know whether a new gate reduced rework or just moved it. With one, every subsequent change to prompts, models, or verification depth can be judged on what actually matters: the cost of producing a verified change.
The full discussion is in the on-demand webinar “The Code Is Fine. The Security Isn’t.”