The Model's Tell: Measuring Context-Leakage Attack Signals with Behavior Gauges

Maosen Zhang, Jianshuo Dong, Boting Lu, Wenyue Li, Xiaoping Zhang +3 more
8/18/2026
1 citation
cs.CRcs.AI

Official code: yeasen-z/LeakGauge (4 stars, Python, last commit 2026-09-05).

Abstract

LLMs increasingly rely on external contexts, such as pre-defined system prompts or retrieved documents, to improve generation quality. However, processing these contexts alongside user queries creates an attack surface: adversarial inputs can induce models to disclose them.

Show full abstract

Prior probing studies suggest that leakage-related signals emerge in hidden states, yet the need to extract these states poses additional deployment challenges. In this paper, we explore whether this internal signal leaves a more accessible ``tell'' before decoding. We propose LeakGauge, which probes this response by appending a suffix that gauges leakage behavior and mapping its prefill token probabilities to an attack-risk score. While a direct gauge uses the initial tokens of confidential content, we find that a content-agnostic one that verbalizes leakage behavior yields more robust signals. Across 11 LLMs, including GLM-5.2 (753B) and Kimi-K3 (2.8T), LeakGauge reaches an AUROC range of 0.944--0.996 on unseen attacks. The signal remains stable when the content changes language or the attack shifts from verbatim to semantic disclosure. By activation-steering interventions, we further show that the risk score is sensitive to an internal leakage-related direction, relating the observable signal to the model's internal representation. In addition, LeakGauge enables an input detector with fewer than 0.5K extra parameters and added latency of 10.34 ms. Code: \href{https://github.com/yeasen-z/LeakGauge}.

View on arXivView PDF

Code Implementations(1)

yeasen-z/LeakGaugeOfficial100%

A pre-decoding detection method for system prompt leakage and RAG leakage attacks.

40PythonMay 25, 20262 months ago
agentsleakage-detectionlogprobsrag

Similar Papers

Cite this paper

@article{zhang2026models,
  title  = {The Model's Tell: Measuring Context-Leakage Attack Signals with Behavior Gauges},
  author = {Maosen Zhang and Jianshuo Dong and Boting Lu and Wenyue Li and Xiaoping Zhang and Tianwei Zhang and Jie Zhang and Han Qiu},
  year   = {2026},
  eprint = {2608.17829},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.17829v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.17829.svg)](https://codeofpaper.com/paper/2608.17829)

Discussion