As CTO, I spend a lot of time thinking about technical risk. But this stat from the recent DryRun Security study stopped me cold: 87% of pull requests from AI coding agents (Claude, Codex, Gemini) contain vulnerabilities, exposing access control gaps, injection risks, and design flaws.
Let me put that in context. If 42% of our code is AI-generated and 87% of that contains vulnerabilities, we’re talking about potentially 36% of our entire codebase having security issues. And by 2027, when AI-generated code hits 65%, that could be 56% of our codebase.
We’re not just shipping faster. We’re potentially building on broken foundations.
What’s the Baseline?
The critical question: how does this compare to human-written code? Another study found that 62% of AI-generated code contains design flaws or known security vulnerabilities—even when using the latest foundational models. Meanwhile, human developers writing from scratch have vulnerability rates closer to 20-30% depending on the domain.
That’s 2-3× worse. And unlike human developers who learn from mistakes, AI models keep making the same categories of errors.
The Types of Vulnerabilities We’re Seeing
In our cloud migration project, security audits have flagged AI-generated code for:
1. Access control gaps - AI assumes happy path authentication, misses authorization edge cases
2. Injection vulnerabilities - SQL injection, command injection, XSS in user input handling
3. Insecure defaults - Permissive configurations, missing encryption, weak validation
4. Logic flaws in security-critical paths - Race conditions, incomplete error handling
5. Excessive I/O operations (~8× more common in AI code) - Potential DoS vectors
The pattern: AI optimizes for “it works” not “it’s secure.” Security requires adversarial thinking—imagining how things could break or be exploited. AI models are trained on making things work, not breaking them.
The CTO Responsibility Dilemma
I’m responsible for balancing innovation with risk management. AI coding tools promise competitive advantage through speed. But if they’re introducing 2-3× more vulnerabilities, what’s my fiduciary responsibility?
In our mid-stage SaaS company, a security breach could:
- Destroy customer trust
- Trigger regulatory penalties
- Expose us to lawsuits
- Tank our Series B valuation
The velocity isn’t worth it if it creates existential risk.
What We’re Changing
After seeing the security data, I’ve implemented:
1. Enhanced review for AI-generated code
- Security-focused code review checklist for AI-assisted PRs
- Mandatory security engineer review for authentication/authorization code
- Static analysis tools tuned to catch common AI vulnerabilities
2. AI-free zones
- Banned AI assistance in security-critical components
- Authentication, authorization, encryption, PII handling = human-only
- Payment processing, data export, admin functions = human-only
3. Verification before velocity
- Acceptance criteria now include “security review complete”
- Velocity metrics no longer count until security sign-off
- Promoting engineers who catch security issues, not just those who ship fast
4. Audit trail requirements
- PRs must indicate AI-assisted sections
- Security reviews must explicitly verify AI-generated code
- Incident reports track whether AI was involved
The Uncomfortable Questions
If 87% of AI PRs contain vulnerabilities:
- Should we treat AI-generated code as untrusted by default?
- Are we creating security debt that will take years to remediate?
- What’s our liability if an AI-generated vulnerability causes a breach?
- Can we maintain SOC 2 / ISO 27001 compliance with high-risk AI code?
I don’t have all the answers. But I know that ignoring security implications because we want velocity is how breaches happen.
What are other CTOs and security-minded leaders doing?
Michelle Washington | CTO | Mid-stage SaaS | 25 years in tech | Security-first mindset