arXiv:2605.28734cs.CRcs.CL2026-05

构建首个可信的恶意代码请求基准库,区分代码生成与安全知识请求

Code as a Weapon: A Consensus-Labeled Prompt Bank for Measuring Coding-Model Compliance with Malicious-Code Requests

论文配图:Code as a Weapon: A Consensus-Labeled Prompt Bank for Measuring Coding-Model Compliance with Malicious-Code Requests
图 1 · 摘自论文原文
  • 通过五名独立评审员共识标注8个数据集共6675条提示
  • 识别出4748条可执行恶意代码请求与1923条安全知识请求
  • 跨数据集和评审团队验证分类稳定性,适合评估代码模型安全性

通用语言模型响应有害问题仅生成文本;而代码模型若服从恶意请求,则可能输出可运行的攻击工具(如键盘记录器、勒索软件、漏洞利用程序)。这一严重性差异表明,代码专用模型应比通用聊天模型有更高的拒绝标准。然而当前领域无法判断其实际表现。现有恶意代码拒绝基准存在碎片化问题:将可执行软件请求与有害安全知识请求混杂,并在不可比数据集上报告拒绝率。本文核心发现是,先前在四个数据集上确立的‘代码-知识’分类轴在大幅扩展的数据池和独立更新的评审团队下依然稳定,证明该分类反映真实语义构念而非提示或评审偏见所致。八个数据集(ASTRA、CySecBench、AdvBench/harmful_behaviors、JailbreakBench、MalwareBench、RedCode、RMCBench、Scam2Prompt)经五名评审员共识标注(6,675条提示 × 5人 = 33,375次判断),获得Fleiss' kappa = 0.767 [95% CI 0.755, 0.777](显著水平)。关键的是,新评审团与旧版无重叠(原用五家商业API,现改用五家开源模型),但对3,133条共享提示达成94.45%一致,二元重叠3,031条上达Cohen's kappa = 0.952 [0.942, 0.963],证实分类轴在几乎完全更换评审团队后仍保持稳健。最终发布包含4,748条共识-代码请求与1,923条共识-知识请求的基准库,其分类轴在数据扩展与评审团队替换中均表现稳定。

原文摘要 · Abstract (English)

A general-purpose language model that answers a harmful question returns text; a coding model that complies with a malicious request can return a working weapon: a keylogger, ransomware, an exploit that runs as written. This asymmetry in the severity of a single act of compliance implies coding-specialized models should clear a higher refusal bar than general-purpose chat models, not a lower one, yet the field cannot tell whether they do. Refusal benchmarks for malicious code are fragmented: they mix requests for executable software with requests for harmful security knowledge and report refusal rates over non-comparable corpora. This paper's central result is that the CODE-versus-KNOWLEDGE classification axis established in a prior four-corpus release remains stable under a substantially expanded corpus pool and an independently refreshed judge panel, evidence that it measures a real construct rather than an artifact of the prompts or judges. Eight corpora spanning diverse elicitation paradigms (direct, jailbreak-decorated, indirect, and agent/interpreter: ASTRA, CySecBench, AdvBench/harmful_behaviors, JailbreakBench, MalwareBench, RedCode, RMCBench, Scam2Prompt) are classified under a five-judge consensus protocol (6,675 prompts x 5 judges = 33,375 calls), reaching Fleiss' kappa = 0.767 [95% CI 0.755, 0.777] ("substantial"). Critically, the panel shares no judge with the prior release (five paid commercial APIs replaced by five open-weight models from five vendors), yet the two panels agree on 94.45% of the 3,133 shared prompts and reach Cohen's kappa = 0.952 [0.942, 0.963] on the 3,031-prompt binary overlap: the axis survives near-total panel replacement. The released bank comprises 4,748 consensus-CODE and 1,923 consensus-KNOWLEDGE prompts, a reliability-quantified benchmark whose central classification axis is shown stable across corpus expansion and judge-panel replacement.

代码安全恶意请求基准测试模型合规

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。