Security-focused prompts cut findings by a third but double dependency surface
Appending an OWASP-aligned security block to prompts reduces reported security findings per generated app by about 35% while roughly doubling the number of dependencies
AI/ML arXiv 20 Nov 2026 Measurement Prototype evidence
Published as “The Effect of Security-Focused Prompts on Reported Findings: A Controlled Experiment on 400 AI-Generated Web Applications”
Why it matters
Embedding a concise OWASP-aligned security block in prompts is a low-cost way to cut reported security findings by about a third and halve high-severity issues in generated source code, though teams must audit the larger dependency set it induces.
Summary
A security-focused prompt block cuts the total number of reported findings by about one third (IRR 0.65, 95% CI 0.60-0.71) across two agentic coding tools. The same block roughly doubles the declared dependency surface, which leads to more high-severity dependency advisories in absolute terms, though the advisory rate per dependency does not increase and high-severity findings in first-party code drop by nearly half. The evidence comes from a controlled experiment on 400 AI-generated web apps with statistical models (negative-binomial and logistic mixed effects) and a detailed dependency-surface analysis. Limitations include confounding of prompt length with security semantics, reliance on tool-reported findings rather than true exploitable bugs, and applicability only to the two studied tools and synthetic specs.
What they found 2
- Security-focused prompting reduces total findings per app by 35%
“variant B was associated with 35% fewer findings per application than variant A (negative-binomial IRR 0.65, 95% CI 0.60-0.71)”
- The block roughly doubles the declared dependency footprint
“Complying with the security block approximately doubled the declared footprint: mean direct dependencies per application rose from 3.2 to 6.3 (claude) and from 3.0 to 6.5 (codex)”
Caveats 6
- Variant B produced more HIGH findings in absolute terms (A: 301; B: 398), because the larger dependency surface introduces additional high-severity advisories.
- The increase in high-severity findings is driven by dependency-layer advisories, not by worse first-party code.
- Outcomes are tool-reported findings, not adjudicated exploitable vulnerabilities, so the measure captures what a standard pipeline reports rather than realized risk.
- variant B confounds security semantics with implementation scope: its prompt is longer and more prescriptive, and it demonstrably causes more functionality and more dependencies to be produced, so the design cannot attribute either the reduction in findings or the change in severity composition to security wording alone.
- The results are conditional on two agentic tools, one hundred specifications, three language ecosystems, and the specific scanners studied.
- Pairwise contrasts were not adjusted for multiplicity, so the individual intervals should be read as descriptive.
What’s new here 4
- Evaluates security-focused prompting at the whole-application level rather than snippet-level.
- Crosses two independently developed agentic coding tools (Claude and Codex) in a single controlled study.
- Measures both total finding volume and the effect on dependency surface and high-severity advisories.
- Provides exposure-adjusted analysis showing that increased advisories stem from larger dependency footprints.