Learning from Failures: A Failure-Driven Prompt Refinement for LLM-Based Vulnerability Analysis
cs.SE, cs.AI, cs.CR
Submitted: 2026-10-06
Updated: 2026-10-06
Comments: Accepted at CSoNet 2026. 15 pages, 6 figures/tables combined
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
The gist: Large Language Models have emerged as promising tools for software vulnerability analysis, but their effectiveness depends heavily on prompt design.
Abstract
Large Language Models have emerged as promising tools for software vulnerability analysis, but their effectiveness depends heavily on prompt design. Existing research primarily compares prompting strategies using aggregate performance metrics, providing limited insight into why models fail or how prompts can be improved systematically. We propose Failure-Driven Prompt Refinement (FDPR), a methodology that analyzes recurring model failures to guide evidence-based prompt refinement. Using the Damn Vulnerable Java Application (DVJA), we identify recurring failure modes, including false positives, false negatives, unsupported reasoning, and CWE misclassification, and translate them into targeted prompt refinements. We then evaluate the resulting prompt on the Juliet Test Suite and perform cross-model validation to assess generalizability. The results show that failure-driven refinement improves the reliability of LLM-based vulnerability analysis while yielding reusable prompt design principles. More broadly, this work demonstrates that recurring model failures provide a principled foundation for prompt engineering, enabling the systematic development of more reliable LLM-based vulnerability analysis systems.
Sources
- PromptAudit: Auditing Prompt Sensitivity in LLM-Based Vulnerability Detection
- Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection
- Vulnerability Detection with Code Language Models: How Far Are We?
- Chasing Shadows: Pitfalls in LLM Security Research
- An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
- Enhancing Reliability in LLM-Based Secure Code Generation
- VulDeePecker: A Deep Learning-Based System for Vulnerability Detection
- Think Broad, Act Narrow: CWE Identification with Multi-Agent Large Language Models
- To Err is Machine: Vulnerability Detection Challenges LLM Reasoning
- LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning
Related papers
- Falsification-Based Verification of LLM-Generated Optimization Models: Sound Test Batteries and Their Detection Limits
- GitSkills: A Dataset of Agent Skills on GitHub
- SABER: Benchmarking Operational Safety of LLM Coding Agents in Stateful Project Workspaces
- PackMonitor: Enabling Zero Package Hallucinations Through Decoding-Time Monitoring
- IntentCoding: Amplifying User Intent in Code Generation
- Incentives and Outcomes in Bug Bounties