RiskyPy: Toward Model-Calibrated Prompt Generation for Joint Security and Functionality Evaluation of LLM-Generated Code
Zacharie Chenail-Larcher, Daniele Lunghi, Melissa Tessa, Quentin Stiévenart, Jacques Klein, Tegawendé F. Bissyandé, Florent Avellaneda, Naouel Moha
Abstract
Evaluating approaches that improve the security of LLM code generation requires datasets that jointly assess security and functionality and remain adapted to the capabilities of the models being studied. However, existing benchmarks are costly to produce and are generally not calibrated to a chosen range of model capabilities. We introduce RiskyPy, an automated pipeline that generates security-oriented code-generation datasets calibrated to model proficiency using functionality and vulnerability canaries. We instantiate RiskyPy for Python using domains covering 18 CWEs from the 2025 CWE Top 25, producing 101 prompts. Experiments on Qwen3-4B and Seed-Coder-8B show that the generated tasks remain functionally accessible, with 57-72% of prompts yielding functional code, while only 5-10% of generations are free of Bandit findings, leaving room for joint evaluation of security and functionality of security improvement approaches.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI, cs.SE
Related papers
Who Is Prompt-Injecting Coding Agents? An Empirical Study of Hidden AI-Directed Text on GitHub
Shared title terminologycs.CRGabi Nakibly, Zvika Babo
Constraint-Aware Evaluation of Reinforcement Learning and Unsupervised Anomaly Detection for Security Operations Alert Triage
Shared title terminologycs.CRRadityo Ghifiardi, Rifny Rachman
Extracting System Prompt of LLM Services in Complex (Agentic) Settings: Hierarchical Optimization and Reliable Evaluation Metrics
Shared title terminologycs.CRShuaidong Li, Xinshan Yang, Yufei Chen et al.
CloakFEM: Agentic FEM Code Generation for Red-Teaming Computational Resource Exhaustion
Shared title terminologycs.CRLi Zheng, Simin Chen
Fixed Detectors, Moving Code: How Well Do Static Security Analyzers Hold Up over a Decade of C/C++ Evolution?
Shared title terminologycs.CRJunhua Tang, Zhengsong Zhang. Haipeng Cai
IAMRAGBENCH: Benchmarking Authorization Expansions in LLM-Generated AWS IAM Policies under RAG Poisoning
Shared title terminologycs.CRHasan Kaplan, Indika Kumara, Willem-Jan van den Heuvel et al.