<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5" -->

---
title: Is Prevention Solved for Agent-Generated Code? | daily.dev
description: An argument that preventing security vulnerabilities in agent-generated code is architecturally solved, but organizationally hard to operationalize. It maps...
canonical: https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Is Prevention Solved for Agent-Generated Code? | daily.dev
og:description: An argument that preventing security vulnerabilities in agent-generated code is architecturally solved, but organizationally hard to operationalize. It maps...
og:url: https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5
og:image: https://api.daily.dev/og/posts/FaM4hx7a5.png
og:image:alt: Is Prevention Solved for Agent-Generated Code?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Is Prevention Solved for Agent-Generated Code?

**[Snyk](https://daily.dev/sources/snyk)** · 17 min read · 0 upvotes · 0 comments

## Summary

An argument that preventing security vulnerabilities in agent-generated code is architecturally solved, but organizationally hard to operationalize. It maps four control types to Laurie Voss's loop model of agentic development: cheap in-context guidance for known risk classes, deterministic scanning inside the inner loops for novel or long-tail issues, LLM-based semantic scanning for authorization and business logic flaws (citing Snyk VulnBench JS 1.0 showing nearly half of single-run LLM findings don't reproduce across runs), and adversarial pentesting/red teaming for runtime-only risks. The piece frames prompting alone as insufficient, argues security controls should be quick to adopt, minimally disruptive, and easily removable given how fast agentic tooling is changing, and closes by positioning Snyk's Trusted Output Assurance and Continuous Offensive Security products against these four control points, while noting remediation of existing vulnerability backlogs remains a separate unsolved problem.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://snyk.io/blog/is-prevention-solved>

## Questions this post answers

### How consistent are LLM-based security code reviews when run multiple times on the same codebase?

LLM-based security reviews are highly inconsistent across repeated runs. Snyk VulnBench JS 1.0, measured across 300 runs of the same review, found that nearly half of what a model identifies on its own in a single run turns up in only one of five runs. This means a single scan is not a reliable decision point; confidence requires repetition, and cost per finding becomes significant at this stage.

_Anyone weighing LLM security scanners for their pipeline can track benchmarks like this via daily.dev before trusting a single run._

### Why can't you just tell an AI coding agent to write secure code via a system prompt?

Instructing an agent to write secure code shifts the probability of what gets produced but does not guarantee it, because models weigh all inputs and make relative judgments rather than following instructions as hard constraints. AI-generated code remains susceptible to the same vulnerability classes as human-written code, such as SQL injection or hardcoded secrets, regardless of prompt quality.

_Teams designing agent guardrails can follow ongoing analysis of prompting limits on daily.dev._

### What kinds of security vulnerabilities can deterministic scanning tools catch versus what requires LLM-based semantic analysis?

Deterministic scanners reliably catch predictable, syntactic risks like SQL injection, XSS, hardcoded secrets, weak crypto defaults, and infrastructure-as-code misconfigurations, since these can be defined in advance. Authorization and business logic flaws, such as broken object-level authorization, IDOR, tenant isolation failures, and multi-step abuse, are semantic rather than syntactic, so rules-based engines perform poorly and require LLM-based scanning of the assembled codebase instead.

_Developers deciding which scanner fits which vulnerability class can compare approaches on daily.dev._

## Similar posts on daily.dev

- [The New Security Risks of Agentic Development](https://daily.dev/posts/the-new-security-risks-of-agentic-development-rjskp1wg4) · Snyk · 1 upvotes · 0 comments
- [The Great Decoupling: Scaling the Outer Loop for the Agentic Era](https://daily.dev/posts/the-great-decoupling-scaling-the-outer-loop-for-the-agentic-era-a5fojtyav) · DevOps.com · 1 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#ai-coding](https://daily.dev/tags/ai-coding), [#appsec](https://daily.dev/tags/appsec), [#devsecops](https://daily.dev/tags/devsecops)

[View this post on daily.dev](https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Is Prevention Solved for Agent-Generated Code?","url":"https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5"},"datePublished":"2026-09-10T18:11:58.392Z","dateModified":"2026-10-15T02:22:09.006Z","description":"An argument that preventing security vulnerabilities in agent-generated code is architecturally solved, but organizationally hard to operationalize. It maps...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed49060c65fe3757d033566e6157be0d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed49060c65fe3757d033566e6157be0d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Snyk","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Snyk","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/8fb2a7b471c04bac9af29fbeb3ed1cf6","url":"https://daily.dev/sources/snyk"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,ai-coding,appsec,devsecops","timeRequired":"PT17M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Snyk","item":"https://daily.dev/sources/snyk"},{"@type":"ListItem","position":3,"name":"Is Prevention Solved for Agent-Generated Code?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/is-prevention-solved-for-agent-generated-code--fam4hx7a5#faq","mainEntity":[{"@type":"Question","name":"How consistent are LLM-based security code reviews when run multiple times on the same codebase?","acceptedAnswer":{"@type":"Answer","text":"LLM-based security reviews are highly inconsistent across repeated runs. Snyk VulnBench JS 1.0, measured across 300 runs of the same review, found that nearly half of what a model identifies on its own in a single run turns up in only one of five runs. This means a single scan is not a reliable decision point; confidence requires repetition, and cost per finding becomes significant at this stage. Anyone weighing LLM security scanners for their pipeline can track benchmarks like this via daily.dev before trusting a single run."}},{"@type":"Question","name":"Why can't you just tell an AI coding agent to write secure code via a system prompt?","acceptedAnswer":{"@type":"Answer","text":"Instructing an agent to write secure code shifts the probability of what gets produced but does not guarantee it, because models weigh all inputs and make relative judgments rather than following instructions as hard constraints. AI-generated code remains susceptible to the same vulnerability classes as human-written code, such as SQL injection or hardcoded secrets, regardless of prompt quality. Teams designing agent guardrails can follow ongoing analysis of prompting limits on daily.dev."}},{"@type":"Question","name":"What kinds of security vulnerabilities can deterministic scanning tools catch versus what requires LLM-based semantic analysis?","acceptedAnswer":{"@type":"Answer","text":"Deterministic scanners reliably catch predictable, syntactic risks like SQL injection, XSS, hardcoded secrets, weak crypto defaults, and infrastructure-as-code misconfigurations, since these can be defined in advance. Authorization and business logic flaws, such as broken object-level authorization, IDOR, tenant isolation failures, and multi-step abuse, are semantic rather than syntactic, so rules-based engines perform poorly and require LLM-based scanning of the assembled codebase instead. Developers deciding which scanner fits which vulnerability class can compare approaches on daily.dev."}}]}
```

