The Effect of Security-Focused Prompts on Reported Findings: A Controlled Experiment on 400 AI-Generated Web Applications
Darko Andro\v{c}ec
Key points
From the paper's conclusion- The block cut findings per application by a third (incidence-rate ratio 0.65, 95% CI 0.60-0.71), equally through both tools, and roughly doubled the declared dependency surface, so variant-B applications carried more high-severity dependency advisories.
Abstract
Agentic coding tools turn a specification into a running web application, so their defaults for authentication, sessions, input validation, and dependencies become its security posture. This study asks whether appending a fixed block of OWASP-aligned security requirements to the prompt changes what such tools produce, by how much, and with what side effects. Each of 100 frozen specifications was realized four times: two agentic tools (Claude Code, Codex CLI) crossed with two prompts sharing a byte-identical functional core, without (A) and with (B) the security block. A fixed static and dynamic pipeline scanned the 400 applications, yielding 6,721 triaged findings, analyzed with count and logistic mixed models and with a dependency diff. The block cut findings per application by a third (incidence-rate ratio 0.65, 95% CI 0.60-0.71), equally through both tools, and roughly doubled the declared dependency surface, so variant-B applications carried more high-severity dependency advisories. Adjusted for that surface the advisory rate did not rise (flat per application, 18% lower in aggregate), while high-severity findings in first-party source fell by nearly half. Security-focused prompting is therefore an inexpensive and portable improvement, but it enlarges the dependency surface that has to be audited against it, an effect of library selection rather than of the security requirements themselves.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Vibe Coding and Web Application Security: A Twin-Prompt StudyarXiv · 2026
- The reach of a verification tool decides its value: A controlled study of verification surface, artifact quality, and cost in AI coding agentsarXiv · 2026
- Securing AI-Generated Code: A Just-in-Time Vulnerability Detection and Remediation PipelinearXiv · 2026
- Applying Security by Design at the Point of Execution: How Governed Security Requirements Affect the Security of AI-Generated CodearXiv · 2026
- Can Agentic Code Review Catch Vulnerabilities Before They Are Merged?arXiv · 2026
- Security Tests as Executable Specifications for LLM Code Generation: Benefits, Trade-offs, and Coverage LimitsarXiv · 2026