I need to share something that’s been keeping me up at night lately. ![]()
Last week I was reviewing a component that my team shipped—a beautiful, accessible modal dialog built with Cursor’s help. Clean code, semantic HTML, proper ARIA labels. Everything looked great until our security engineer flagged it during a routine audit. The modal had a reflected XSS vulnerability that neither I nor our code reviewer caught.
The AI had helpfully generated the component, but it also helpfully introduced a security flaw that could expose user data.
This got me digging into what’s actually happening with AI-generated code in production, and the numbers are… concerning.
The Numbers Don’t Lie (But They’re Scary)
According to recent research:
- AI-generated code is now 24-50% of all production code worldwide (varies by region, but trending toward 50% in early 2026)
- 45-48% of AI-generated code contains security vulnerabilities
- AI code introduces 2.74x more vulnerabilities than human-written code
- 35 new CVE entries in March 2026 alone were directly caused by AI-generated code—up from just 6 in January
Let that sink in for a moment. We’ve gone from 6 to 35 CVEs per month in just two months.
Sources: Veracode AI Code Security Research, Infosecurity Magazine, The Register
The Productivity Paradox
Here’s what makes this really tricky: AI tools are making us faster, but are they making us better?
I use Copilot and Cursor every single day. They’ve genuinely 10x’d my ability to prototype ideas and build component libraries. But there’s this uncomfortable truth—I’m moving faster while potentially introducing 2.74 times more security issues.
It’s like we’ve built a productivity engine that runs on technical debt fuel. ![]()
![]()
Research from Apiiro found that AI-generated code in Fortune 50 companies shows:
- 322% more privilege escalation paths
- 153% more design flaws
- 40% jump in secrets exposure
Source: SoftwareSeni AI Security Analysis
Are We Measuring the Right Things?
This is where my design systems brain kicks in. We’re optimizing for the wrong metrics.
We celebrate:
- Lines of code written per day

- Features shipped per sprint

- Pull requests merged

But we’re not tracking:
- Security debt introduced per day

- Time spent fixing AI-generated vulnerabilities

- Blast radius of AI-suggested anti-patterns

It’s like celebrating how fast you can pour a foundation without checking if it’s level. Eventually, everything built on top starts to lean.
The RoguePilot Problem
And it gets worse. Security researchers just demonstrated “RoguePilot” attacks where threat actors can inject malicious prompts into configuration files that instruct Copilot to insert malicious code—code that bypasses typical code reviews because it looks contextually appropriate.
Repositories using Copilot now show 6.4% secret leakage rates—that’s 40% higher than traditional development.
Source: Pillar Security Research
So What Do We Do?
I’m not saying we should stop using AI tools. I’m not going to stop using them—they’re too valuable for iteration and exploration. But I think we need to have an honest conversation about:
- Review processes: How do we review AI-generated code differently than human-written code?
- Training: Are we teaching engineers to spot AI-introduced vulnerabilities?
- Metrics: Should we be tracking “AI code percentage” alongside test coverage and security metrics?
- Architectural guardrails: Can we build systems that make insecure code harder to ship, regardless of who (or what) wrote it?
My Question for Engineering Leaders
What are you doing about this in your organizations?
Are you:
- Treating AI code as third-party code requiring extra scrutiny?
- Running additional security scans on AI-generated commits?
- Training your teams on AI-specific security risks?
- Just hoping really hard that nothing explodes?

Because from where I sit, it feels like we’re collectively building something that’s going to break in spectacular fashion. And I’d really like to be wrong about that.
What am I missing here? Is anyone successfully balancing AI productivity with security quality?
Full disclosure: I still love my AI coding tools. I’m just scared we’re using them too naively.