arXiv:2608.09643cs.CRcs.LG2026-08中稿 · ICML

模型激活值能捕捉提示词忽略的代码安全信号

Activation Probes Surface Code-Security Signals that the Model's Output Misses

  • 用线性探测器分析开源评审模型的激活值
  • 在61%-67%的漏洞案例中,激活值正确识别脆弱函数
  • 适合关注模型内部安全信号的研究者和开发者

AI编程代理正编写越来越多的生产代码,但人工安全审查无法跟上代码生成速度。当前主流代理为闭源权重模型,部署团队无法查看其内部机制。可改用开源权重模型作为代码审查工具,其激活值可读。我们探究读取这些激活值是否能恢复提示词无法捕获的安全信号。在配对的易受攻击与修复后Python函数语料上,为每个模型训练单个线性探测器,再在未见漏洞类型的真实漏洞数据上测试,覆盖五种开源评审模型。对于仅修改单一函数即可修复的漏洞,探测器在61%-67%的情况下将脆弱函数得分高于修复版本,显著优于50%随机水平。同时,该探测器性能也优于同一模型基于日志输出的提示式问答准确率,在所有尝试的提示下均表现更优。要求模型给出文字判断,即使使用思维链,也常对脆弱与修复函数给出相同答案,无法区分。这表明模型激活值蕴含了提示词所遗漏的代码安全信号。

原文摘要 · Abstract (English)

AI coding agents now write a growing share of production code, and human security review does not scale at the rate code is generated. The agents in widest use are closed-weight, so a deploying team cannot read their internals. It can instead run an open-weight model as a reviewer over the agent's output. That reviewer's activations are readable. We ask whether reading those activations recovers a security signal that simply asking the same reviewer misses. We fit a single linear probe per model on a corpus of paired vulnerable-and-fixed Python functions, then test it without retraining on real disclosed vulnerabilities whose weakness type the probe never saw in training, across five open-weight reviewer models. On the vulnerabilities fixed by changing a single function, the probe scores the vulnerable function above its fix on 61-67% of cases for every model, beating the 50% chance line. It also beats the same model's prompted YES/NO win-rate read from its logits, under every prompt we try. Asking the model for a written verdict, even with chain-of-thought, returns the same answer on the vulnerable and fixed function most of the time and so cannot tell them apart. Model activations carry a code-security signal that prompting the same model misses.

代码安全模型探针激活值分析

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