How Cal.com Rebuilt AppSec After Going Closed Source
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security

The cmu ai code study findings are pretty uncomfortable if your team leans on AI coding tools. 61% of generated code functions correctly. 10.5% passes security review. That means code can return the right values, handle expected inputs, and still contain an injection flaw or a missing access control check. We tend to treat test passage as a quality signal, but the CMU research shows that signal tells you almost nothing about what lives underneath.
TLDR:
The researchers behind this study didn't ask a simple question like "can AI write code?" They set up a controlled experiment across 80 coding tasks spanning five programming languages: Python, JavaScript, TypeScript, Java, and C. Each task was assigned to one of four popular AI coding tools, and the output was scored against two separate criteria: functional correctness and security.
The results split cleanly along those two dimensions. Roughly 60% of the generated code worked as intended. Only about 10% met a reasonable security standard.
That gap is the finding worth paying attention to. A piece of code can pass its test suite, return the right values, and handle the expected inputs, while simultaneously containing an exploitable vulnerability. Functional correctness and security are orthogonal properties, and AI models optimized for the former show little evidence of reasoning about the latter. Teams looking for a structured response should review securing AI-generated code before scaling these workflows.
The study applied security evaluation criteria grounded in real vulnerability classes, not stylistic preferences. Reviewers assessed whether generated code introduced common weaknesses: injection flaws, insecure defaults, missing input validation, improper error handling, and related categories that appear consistently in production incident reports.
This is worth noting because "secure" in this context wasn't a moving target or a vague quality bar. The 10% figure reflects code that would survive scrutiny against known, documented vulnerability patterns, not a theoretical ideal.
The CMU study landed at an interesting moment in the AI coding tool cycle. By mid-2025, the developer tooling market had moved past early experimentation. GitHub Copilot had been generally available for three years. Cursor had grown into a widely adopted tool among professional developers. Claude and GPT-4 were being called inside CI pipelines and chat windows alike, part of a broader wave of best AI code security tools that teams were assessing for production use. Developers were no longer asking whether to use AI for code generation. They were asking how much of their workflow to hand over.
That context matters for interpreting the findings. A study showing 60% functional code and 10% secure code in 2022 would have been a footnote about immature tooling. The same numbers in 2025 describe production behavior at scale. Security teams reviewing pull requests, auditing repositories, and triaging findings are doing so against a backdrop where a large fraction of the code they see was written with AI assistance.
The study also arrived as regulatory and compliance pressure was building. The EU Cyber Resilience Act had moved into enforcement planning. NIST was updating secure software development guidance. Organizations were being asked to account for how their code was produced, and also whether it passed a scan, a question that touches core SAST vs DAST trade-offs that compliance teams were revisiting. A benchmark from a credible research institution gave security and engineering leadership a concrete reference point for those conversations.
AI coding assistants do accelerate development. Studies show developers using GitHub Copilot complete tasks 26% faster on average. That speed gain is real, and teams feel it immediately.
The problem is that the gain compounds a hidden cost. When code ships faster, so do the bugs inside it. The CMU study found that 61% of AI-generated code ran correctly, which sounds acceptable until you look at the security layer: only 10.5% met basic security standards. Speed without correctness is just a faster way to accumulate debt.
The debt is not distributed evenly. The vulnerabilities that AI tools introduce at pace (missing input validation, broken access control logic, injection paths left open across generated functions) are the categories that take longest to remediate once they reach production. A developer who writes a feature in 26% less time and ships an authorization bypass in the same commit has not saved time. They have shifted the cost forward and compounded it with remediation effort, incident response, and the organizational drag of a security finding that surfaces weeks or months after the original commit.
The velocity illusion breaks down further when you account for review load. Security teams inherit the full output of AI-assisted development, including the fraction that compiles cleanly. A codebase growing 26% faster generates proportionally more surface area for static analysis, more findings to triage, and more manual review hours before any finding can be closed. The net throughput gain at the team level is narrower than the individual productivity numbers suggest, and in teams without tooling calibrated for AI-generated code, it can invert entirely.
The precise figures: 61% of AI-generated code functions correctly, while only 10.5% passes security review. Fewer than 11 out of every 100 generated snippets clear a basic security bar.
That gap traces back to training objectives. AI coding models are trained and scored on whether generated code runs and produces the right output, not on whether it handles edge cases, validates inputs, or enforces access controls. Correctness and security are different targets, and these models were only ever aimed at one of them.
AI code generators produce output that looks correct. It compiles, passes tests, and ships. The security problems surface later, usually under conditions no unit test exercises.
The CMU research gives that pattern a number. Across the tasks studied, 60% of outputs functioned as intended. Only 10% cleared security review. The gap between those two figures is where real exposure lives.
A few structural reasons explain the gap:
| Failure Mode | Root Cause | Consequence |
|---|---|---|
| Training objective mismatch | LLMs optimize for outputs that match training patterns: code that runs, not code that resists abuse. Security properties rarely appear in training labels. | The model has no direct signal to optimize against security; it is structurally blind to it. |
| Implicit input trust | LLMs generate for the happy path because that is what training examples show. Validation, sanitization, and boundary checks require anticipating adversarial use. | Generated code accepts untrusted input without sanitization, leaving injection paths open. |
| Context-blind authorization | Who is allowed to do what depends on the broader system, not the function in isolation. A model generating a single function cannot reason about trust boundaries it cannot see. | Access control logic is produced without modeling the trust boundary being crossed. |
| Compressed error handling | Generated code often silences exceptions or returns generic responses to satisfy functional requirements. | Internal state is exposed to callers who should not see it, leaking information under failure conditions. |
The result is code where the functional requirements pass and the security requirements were never part of the specification the model was solving for.
As AI coding tools accelerate development velocity, the volume of code reaching review and production keeps climbing. More code means more surface area, and the static analysis warnings that accompany it grow proportionally. Security teams that once triaged hundreds of findings per sprint now contend with thousands, many of them low-confidence flags that require manual investigation before anyone can act. This is a core limitation of static code analysis that becomes more acute as AI output volume grows.
Code complexity compounds the problem. AI-generated code tends toward verbose, deeply nested structures that satisfy functional requirements but obscure control flow. When a static analyzer encounters those patterns, it produces more warnings, not fewer, because the signal-to-noise ratio degrades as path counts increase.
The result is a backlog that grows faster than teams can clear it. Engineers deprioritize security review not from negligence but from arithmetic: there are more findings than hours, and the cost of investigating a false positive is identical to investigating a real one until someone does the work.
There is a measurable gap between how confidently developers ship AI-generated code and how secure that code actually is. When AI tools produce code that compiles, passes tests, and looks syntactically correct, developers tend to treat it as production-ready. The CMU study puts a number on why that assumption breaks down: roughly 60% of AI-generated code works as intended, but only about 10% meets security standards.
That gap matters because the failure mode is invisible at the surface level. Functional code and secure code look identical to a developer reviewing output from an AI coding assistant. The bugs that make code insecure are not syntax errors or obvious logic failures. They tend to be missing input validation, improper authentication checks, or subtle trust boundary violations that only surface under adversarial conditions.
Several patterns in developer behavior amplify the risk:
The result is a class of ai code bugs that are structurally different from traditional developer errors. They are not random. They cluster around the exact conditions where AI code generation is weakest: access control logic, input handling, and any behavior that depends on context the model cannot see.
The CMU study is valuable precisely because it is narrow. It tested AI-generated code written in response to specific prompts across a defined set of task types, which means its findings describe a controlled experimental environment, not the full range of production codebases where AI tools are used today.
A few constraints are worth keeping in mind when reading the results.
The study drew from a fixed pool of coding tasks. Real engineering work spans more varied contexts, including legacy system integrations, complex authorization schemes, and multi-service architectures where security properties are harder to assess against a single correctness standard.
The security evaluation methodology focused on identifiable vulnerability classes. Logic flaws and access control bugs that depend on application-specific business rules are harder to catch in automated assessment, which means the 10% security rate may overstate how secure AI-generated code is in practice.
The research also tested code at the point of generation, before any human review or iterative refinement. Developers who use AI coding tools rarely ship the first output unmodified, so the study captures a worst-case snapshot of what AI produces, not what actually gets deployed.
None of this invalidates the core finding. A 10% security rate under controlled conditions with well-formed prompts is a low ceiling. If anything, the limitations above suggest the real-world picture could be worse, not better.
The CMU findings point toward three workflow adjustments for security-aware engineering teams.
Gecko Security was built around the exact failure modes the CMU research exposes. Where AI coding assistants produce code that compiles and runs but skips input validation, mishandles authentication, or leaves injection vectors open, Gecko's contextual AI SAST reasons over a compiler-accurate semantic model of the codebase to find what those tools leave behind.
The CMU findings map directly to what Gecko catches: insecure cryptographic implementations, improper input handling, and broken access control patterns that appear functional at the surface but fail under adversarial conditions. Gecko traces these across call chains and service boundaries, extending beyond the file where the AI wrote the vulnerable line.
The core problem with reviewing AI-generated code using conventional SAST is a mismatch of approaches. AI assistants produce code that passes syntactic checks. The vulnerabilities that remain, the 90% that the CMU study found failing security standards, tend to be semantic: logic that is structurally valid but contextually wrong.
Gecko reasons over the full semantic graph instead of matching against rule sets. It can identify:
The result is that Gecko catches the category of bugs the CMU study found most common in AI-generated code, the ones that only appear when you trace execution across context instead of scanning line by line.
The CMU study confirms what a careful code review already shows: AI-generated code that runs is not the same as AI-generated code that is safe. Your security posture right now depends on how you account for that gap across every AI-assisted commit in your codebase. Static analysis helps, but the bugs that matter most in AI-generated code are semantic, not syntactic. Talk to the Gecko team about what that distinction looks like in practice.
The CMU study tested 80 coding tasks across five programming languages and found that 61% of AI-generated code functions correctly, while only 10.5% passes security review. The gap exists because AI coding models are trained to produce code that runs and returns correct output, not code that validates inputs, enforces access controls, or handles adversarial conditions.
AI models generate for the happy path because that is what training examples show. The result is code that trusts its inputs, compresses error handling, and produces authorization logic without visibility into the trust boundaries of the broader system. A missing authorization check leaves no visible artifact in a diff, so functional testing and visual code review both miss it, the failure only surfaces under adversarial conditions.
Separate AI-assisted commits from hand-written ones in your version control workflow so you can measure whether the security posture of that subset improves or degrades over time. Without that separation, you cannot tell whether your security controls are keeping pace with the volume of AI-generated code reaching production.
The CMU study tested code at the point of generation before any human review or iterative refinement, making it a worst-case snapshot. The study also focused on identifiable vulnerability classes, meaning logic flaws tied to application-specific business rules, which are harder to catch in automated assessment, may not be fully counted. The real-world rate could be worse, not better.
Gecko Security
The latest news, technologies, and resources from our team.
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security
See what actually changed in the OWASP Top 10 for 2026, from merged SSRF and XXE categories to new supply chain risks and scanner coverage gaps.
Jeevan Jutla
Gecko Security uncovered CVE-2026-21894 in August 2026, an n8n authorization bypass with CVSS 8.8. See why static tools missed it and how to remediate it.
Jeevan Jutla
Security misconfiguration is OWASP A05 for a reason. Learn how deployment context determines exploitability and how to fix gaps in August 2026.
Jeevan Jutla
How do modern AppSec vendors actually compare? This July 2026 capability map covers SAST, DAST, SCA, business logic flaws, and cross-service
Gecko Security
Break down your AppSec stack: what SAST, DAST, SCA, IAST, and pen testing each see — and what they miss. Updated July 2026 by Gecko Security.
Gecko Security
Occasional updates, new content, and insights. No spam; unsubscribe anytime.