---
title: "Discussion on \"AI-Generated Code Security Study 2026: Tests Pass, Exploits Still Work\" | Hashnode"
description: "Discussion on \"AI-Generated Code Security Study 2026: Tests Pass, Exploits Still Work\". An AI-generated code security study of 145 CVE tasks: Claude Code passed tests on 74.0% but only 18.4% was secure. Agents rarely saw the safeguard."
url: "https://hashnode.com/posts/ai-generated-code-security-study-2026-tests-pass-exploits-still-work/6b06461bc20dc5c2d24a992b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [AI-Generated Code Security Study 2026: Tests Pass, Exploits Still Work](https://stackchief.hashnode.dev/ai-generated-code-security-study-2026-tests-pass-exploits-still-work?utm_source=hashnode&utm_medium=feed)

An AI-generated code security study of 145 CVE tasks: Claude Code passed tests on 74.0% but only 18.4% was secure. Agents rarely saw the safeguard.

Nov 25 · 10 min read · stackchief.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#llm](https://hashnode.com/tag/llm)
-   [#interview](https://hashnode.com/tag/interview)
-   [#careers](https://hashnode.com/tag/careers)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)

## Written by

[StackChief](https://hashnode.com/@stackchief)

@stackchief

  
[View profile](https://hashnode.com/@stackchief)

Software engineering, on the record: the AI-era job market, AI engineering and interview prep.

StackChief is an independent publication on the AI-era software job market, AI engineering and interview preparation. Reports are dated and show their sources; errors are corrected in public. How it is made: stackchief.com/standards

## Responses 2

Markdown supported · ⌘↵ to post

[Linkjob AI](https://hashnode.com/@linkjob)

[Nov 26](https://hashnode.com/posts/ai-generated-code-security-study-2026-tests-pass-exploits-still-work/6b06461bc20dc5c2d24a992b/comment/6b0799f63376efb70dc6266d)

The detail that stuck with me is that agents only surfaced the existing safeguard in roughly a third of runs, and that just putting it in context nearly doubled secure output. It makes me think a short "security map" in the repo, pointing to where validation and access checks live, might do more than any prompt reminder. I'm curious whether the authors saw a difference between tasks where the safeguard sat in the same module versus somewhere far away in the codebase.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 25](https://hashnode.com/posts/ai-generated-code-security-study-2026-tests-pass-exploits-still-work/6b06461bc20dc5c2d24a992b/comment/6b066f24226caede0feda3d8)

That CASE-Bench gap—74.0% passing functional tests while only 18.4% resisted a working exploit—quantifies a blind spot every team using coding agents needs to account for. Functional test suites verify the happy path, and since 71% of agent search queries targeted functional code while only 9% looked for security concepts, existing validators and access policies never even entered context in most runs.

Seeing secure output nearly double from 12.6% to 24.8% when annotated safeguards were supplied in context—versus barely moving to 13.9% with a generic security reminder—shows that automated context injection of auth and validation modules beats prompt admonitions.
