arXiv cs.AI· Zacharie Chenail-Larcher, Daniele Lunghi, Melissa Tessa, Quentin Sti\'evenart, Jacques Klein, Tegawend\'e F. Bissyand\'e, Florent Avellaneda, Naouel Moha·· 2026-11-02AI 评分38
RiskyPy:面向 LLM 生成代码的安全与功能联合评测的模型校准提示词生成方法
RiskyPy: Toward Model-Calibrated Prompt Generation for Joint Security and Functionality Evaluation of LLM-Generated Code
AI 导读
RiskyPy 是一个自动生成安全导向代码生成数据集的流程,通过功能与漏洞 canary 将任务校准到模型能力水平。其 Python 实现覆盖 2025 年 CWE Top 25 中的 18 类 CWE,生成 101 条提示词。
正文 · 原文
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.
| Subjects: | Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI); Software Engineering (cs.SE) |
| Cite as: | arXiv:2610.40735 [cs.CR] |
| (or arXiv:2610.40735v1 [cs.CR] for this version) | |
| https://doi.org/10.48550/arXiv.2610.40735 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Daniele Lunghi [view email]
[v1]
Thu, 29 Oct 2026 14:03:12 UTC (184 KB)
来源:arXiv cs.AI · arxiv.org