Developers with AI assistant access wrote less secure code. They were more confident it was secure.
That’s not a paradox. That’s a peer-reviewed finding. Perry et al. (ACM CCS 2023) ran a controlled study: participants using an AI coding assistant produced insecure code on 4 out of 5 programming tasks, yet reported higher confidence in their code’s security than those working without AI. Confidence went up. Quality went down. In opposite directions. But that’s not the real point here.
The instinct is to blame the AI. Better models, better training data, better guardrails. But the AI wasn’t making random mistakes. It was doing exactly what it’s designed to do: replicate patterns from its context.
The problem wasn’t the AI. The problem was that nobody had made the security assumptions visible enough for any tool, human or machine, to follow consistently.
AI Replicates Patterns. It Doesn’t Reason About Security.
Your AI coding assistant doesn’t understand your threat model. It doesn’t know which endpoints handle PII. It doesn’t know that the auth pattern in /api/admin has stricter requirements than /api/public. It doesn’t know your team chose parameterized queries over string concatenation because of a SQL injection incident in 2021.
It sees code. It produces more of it. If your codebase has three different approaches to input validation, one secure, one legacy, one half-migrated, AI treats all three as equally valid examples. It doesn’t prefer the secure one.
Pearce et al. (IEEE S&P 2022) tested this directly: across 89 scenarios and 1,689 Copilot-generated programs, approximately 40% contained CWEs (Common Weakness Enumerations) based on MITRE’s Top 25 most dangerous software weaknesses.
That was a lab setting. Fu et al. (ACM TOSEM 2024) confirmed the pattern in real GitHub projects: 29.5% of Python and 24.2% of JavaScript Copilot code contained security weaknesses across 43 CWE categories.
The breadth matters. AI doesn’t have specific security blind spots. It reflects whatever security, or insecurity, patterns exist in its context. 43 different vulnerability categories means AI isn’t making one predictable mistake. It’s faithfully reproducing whatever it finds.
The False Confidence Loop
The danger isn’t just that AI produces insecure code. It’s that developers believe it doesn’t.
Snyk’s 2024 AI Code Security Report revealed a reinforcement loop that should alarm any technical leader:
Over 75% of developers believe AI-generated code is more secure than human-written code.
Nearly 80% bypass security policies for AI-generated code.
Only 10% scan most of their AI output.
Over 56% admit that AI code introduces security issues.
Read that sequence again. Developers believe the code is secure. They skip the checks because they believe it’s secure. They don’t scan the output to discover otherwise. The belief persists because nobody is testing it.
The Perry et al. finding from the opening isn’t an anomaly. It’s the mechanism. Developers can’t articulate what “secure” means in their specific context. They can’t describe the threat model for the service they’re working on, because it was discussed once in a meeting and never written down. So when AI produces code that looks reasonable and runs correctly, they default to “it looks right.” The implicit assumption goes unchallenged.
At human pace, code review and institutional knowledge caught some of this. At AI pace, the volume overwhelms the human checks, and the false confidence prevents anyone from looking harder.
The Invisible Threat Model
Here’s the uncomfortable truth: most organizations’ security posture was never in the code. It lived in people’s heads.
The senior engineer who knows “we never store session tokens in local storage.” The architect who remembers why they chose HMAC over JWT for internal services. The team lead who catches a missing rate limiter in review because she was there during the DDoS incident two years ago. The operations engineer who knows which third-party APIs require client certificates and which use API keys.
These are valid security controls. They’re also invisible to any tool that reads code.
A human developer eventually absorbs these unwritten rules through onboarding, code review feedback, hallway conversations, and the slow accumulation of tribal knowledge. AI has no onboarding. It has no osmosis. It has the code it can see, and that’s all.
Apiiro’s 2025 analysis of Fortune 50 enterprises quantified the consequence. AI-assisted developers produced 3–4x more commits than their non-AI peers. By June 2025, AI-generated code was introducing over 10,000 new security findings per month, a 10x spike in just six months. Privilege escalation paths jumped 322%. Cloud credentials were exposed nearly twice as often by AI-assisted developers.
But here’s the finding that captures the real problem: syntax errors dropped 76% and logic bugs fell over 60%. The code looks better. It runs. It passes functional tests. It just doesn’t respect security boundaries that nobody told it about.
The pattern is an army of juniors. Syntactically correct. Functionally adequate. Zero architectural judgment. A junior developer eventually absorbs the implicit security context. They learn the unwritten rules. They build the mental model. AI never will. And unlike a junior, it operates at scale.
Meanwhile, Veracode’s State of Software Security (2025), drawing on 15 years of longitudinal data, shows fix times growing to 252 days on average, up 47% since 2020. Half of all organizations carry critical security debt. Code creation accelerates. Security remediation decelerates. The gap between those two curves is where implicit assumptions become exploitable.
From Tacit to Explicit
The response isn’t more security documentation that nobody reads. It’s not a threat modeling offsite that produces a slide deck and no follow-through. It’s making security decisions visible where AI, and every developer, can actually see them.
This means three things.
First, at the pattern level. If you want parameterized queries everywhere, there should be one clear, well-used pattern in the codebase, not three competing approaches. If you want schema-based validation, deprecate the regex approach and remove the examples AI might follow. AI follows examples. Make the right example the loudest signal.
This isn’t aspirational. It’s the minimum. Every competing pattern is an invitation for AI to pick the wrong one. Every legacy approach that “still works” is a template for future vulnerabilities.
Second, at the decision level. The why behind security choices needs to be documented. Not in a wiki no one reads. Put it in architectural decision records, threat model artifacts, and comments at the boundary where the decision applies. Even if an AI assistant doesn’t have access to those ADRs during generation, the humans reviewing the output need the written rationale to validate it against the threat model. Without that rationale, a reviewer has no basis to say “this AI-generated code violates our threat model,” because the threat model isn’t written anywhere. A later article in this series will explore decision documentation in depth.
Third, at the constraint level. The security assumptions that matter most need to be machine-enforceable: banned functions, required patterns, dependency restrictions. This is where articulation becomes enforcement. Later articles in this series will address guardrails and architecture enforcement in CI. This article’s point is simpler: you can’t build the constraint until you’ve articulated the assumption. You can’t write a rule that blocks insecure validation patterns if you haven’t first agreed on which pattern is the secure one.
Veracode’s 2024 State of Software Security report provides the positive evidence: organizations with active, prompt security practices reduce critical security debt by 75%. The mechanism isn’t magic. Explicit practices create feedback loops. Implicit assumptions don’t.
The Silence Is the Vulnerability
The vulnerability data is alarming. Over 10,000 new security findings per month. Privilege escalation paths up 322%. Fix times growing while code volume triples. But the root cause isn’t that AI writes insecure code.
It’s that your security was always carried by people. Their expertise. Their memory. Their attention in review. AI bypasses all three. It produces code that passes through none of the informal channels where security assumptions were traditionally transmitted.
Every security assumption that lives in someone’s head is an assumption AI will violate. Not because AI is hostile. Because it was never told.
The organizations that will remain secure under AI acceleration are the ones that translated their security knowledge from tacit to explicit before the volume arrived. Not more documentation for documentation’s sake. Visibility: making the right patterns obvious, the decisions documented, and the constraints enforceable.
When that’s done, AI becomes a security amplifier, generating code that follows the patterns because the patterns are there to follow. Until then, it amplifies whatever it finds. Including the insecure legacy pattern nobody got around to removing.
Pick any security assumption your team holds. Now ask: where in the codebase would AI learn it? If the answer is “nowhere,” that’s your vulnerability. Not the AI. The silence.


