← Lab /AI/ML

Activation probes detect code vulnerabilities that model prompts miss

Reading model activations reveals a security signal that prompting the same model fails to capture

AI/ML arXiv 10 Aug 2026 Measurement Prototype evidence

Published as “Activation Probes Surface Code-Security Signals that the Model's Output Misses”

Why it matters

Activation-based probes can provide a reliable ranking signal for triaging code generated by AI agents, enabling self-hosted reviewers to flag potentially vulnerable changes that prompting alone misses.

Summary

The paper shows that a linear probe on LLM activations can rank vulnerable Python functions above their fixed versions 61-67% of the time, outperforming the same model's prompted YES/NO answers under every prompting style. This effect holds across five open-weight code models and on 234 real disclosed vulnerabilities, with Wilson 95% confidence intervals staying above chance. The probe also beats prompting when the answer is read from logits, though its edge over chain-of-thought prompting is narrow and sometimes not statistically significant. Evidence comes from a paired win-rate evaluation on unseen bug types; the paper does not provide a deployed system.

What they found 2

  1. The probe scores vulnerable functions higher than their fixes on 61-67% of cases for every model.

    “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”

  2. The probe outperforms the model's prompted YES/NO win-rate read from logits under every prompt.

    “It also beats the same model’s prompted YES/NO win-rate read from its logits, under every prompt we try.”

Caveats 4

  • Its advantage over the strongest prompting (chain-of-thought from the logits) is narrow and not always significant; the clear gap is over no-shot and few-shot prompting.
  • Our out-of-distribution evaluation measures a paired comparison: whether the probe scores a vulnerable function above its own fix (win-rate 61-67%). On unseen weakness types this is a usable ranking signal.
  • We also worked with limited set data and expanding it is future work.
  • Finally, we train only on the four SVEN CWEs with substantial Python coverage.

What’s new here 4

  • Applies linear probes to Python code rather than C/C++ and to unseen weakness types.
  • Evaluates on real disclosed vulnerabilities (PATCHEVAL) rather than synthetic benchmarks.
  • Directly compares activation-based probe rankings to LLM prompting outputs (no-shot, few-shot, chain-of-thought).
  • Shows that activation signals can survive when the model's own textual verdict collapses.