Skip to content

Safer Reasoning Traces: Measuring and Mitigating Chain-of-Thought Leakage in Large Language ModelsSafer Reasoning Traces: Measuring and Mitigating Chain-of-Thought Leakage in LLMs

arXiv· arXiv:2603.05618· Patrick Ahrend, Tobias Eder, Xiyang Yang, Zhiyi Pan, Georg Groh·Indexed by this site · 2026-10-12· Originally publishedDefenses

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors report an average CoT leakage rate of 86.3% across six models (plain: 52.3%), with no single gatekeeper dominating.

Questions
When CoT improves reasoning, PII in the prompt may still enter the reasoning trace and the answer, even if the policy requires not to restate it. The authors aim to measure how this inference-time direct leakage varies with model and budget, and whether lightweight detectors can detect it.
Methods
On the 11-type subset of PII Masking 200k, compare plain prompting with explicit CoT in a black-box setting, defining leakage as reproduction of normalized tokens, weighted by three risk levels. Then compare rules, TF–IDF classifier, GLiNER2, and LLM-as-judge.
Experiments and results
The authors state that the average leakage rate across six models is 52.3% for plain prompting and 86.3% for CoT. o3's CoT is 63.73%, and Llama 3.3 is 99.09% (Table 3). GLiNER2's risk-weighted F1 is 0.841, and the Opus judge's Recall is 0.848.
Limitations and future work
The authors state that they only cover verbatim reproduction on English synthetic data, and did not cover multi-turn dialogue, non-PII attributes, adversarial attacks on gatekeepers, or large-scale human calibration. Experiments ran six models, 11 PII types, and five token limits; Opus was not included in the budget table.
Experimental setupClaude Opus、GPT o3 et al. · PII Masking 200k · leakage rate、Recall et al.
Threat model
Black-box, interface-level, inference-time. The assistant is constrained by an output policy of "do not repeat PII." The attacker can send prompts and observe reasoning traces and answers, or read logs afterward; can modify prompts and CoT budget, but cannot see weights or hidden states. Leakage refers to the reappearance of normalized canonical segments.
Evaluated models
Claude OpusGPT o3Llama 3.3:70BDeepSeek-R1:70BQwen3:32BMixtral 8×22BGLiNER2GPT-o4-miniML-Classifier (TF-IDF + logistic regression)Rule-based gatekeeper
Benchmarks
PII Masking 200k
Metrics
leakage rateRecallMacro-F1risk-weighted F1SPriv
AI summaryThe paper proposes a model-agnostic framework to measure the leakage risk of personally identifiable information (PII) from prompts being reintroduced into the reasoning trace and output during chain-of-thought reasoning in large language models, even under policies that instruct the model not to repeat PII. The framework defines leakage as risk-weighted token-level events covering 11 categories of PII, tracks leakage curves as a function of the allowed chain-of-thought budget, and compares open-source and closed-source model families on a structured PII dataset with hierarchical risk classification. The study finds that chain of thought consistently increases leakage, especially in high-risk categories, and that leakage is strongly correlated with model family and reasoning budget, with higher reasoning budgets amplifying or suppressing leakage depending on the base model. The authors then evaluate four types of lightweight inference-time gating methods—rule-based detectors, TF-IDF + logistic regression classifiers, a GLiNER-based NER model, and LLM-as-judge—measured by risk-weighted F1, Macro-F1, and recall, and find that no single method dominates across all models or budgets, leading them to propose a hybrid, style-adaptive gating strategy.

The paper proposes a model-agnostic framework to measure the leakage risk of personally identifiable information (PII) from prompts being reintroduced into the reasoning trace and output during chain-of-thought reasoning in large language models, even under policies that instruct the model not to repeat PII. The framework defines leakage as risk-weighted token-level events covering 11 categories of PII, tracks leakage curves as a function of the allowed chain-of-thought budget, and compares open-source and closed-source model families on a structured PII dataset with hierarchical risk classification. The study finds that chain of thought consistently increases leakage, especially in high-risk categories, and that leakage is strongly correlated with model family and reasoning budget, with higher reasoning budgets amplifying or suppressing leakage depending on the base model. The authors then evaluate four types of lightweight inference-time gating methods—rule-based detectors, TF-IDF + logistic regression classifiers, a GLiNER-based NER model, and LLM-as-judge—measured by risk-weighted F1, Macro-F1, and recall, and find that no single method dominates across all models or budgets, leading them to propose a hybrid, style-adaptive gating strategy.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    CoT can write PII from the prompt back into the reasoning trace and the answer, and this varies with model and budget.

    PII from the prompt is written verbatim into the CoT or answer at inference time, even when the output policy requires not repeating it.

    • Scenario: The authors believe CoT can improve reasoning, but token-level traces add a privacy surface: personally identifiable information in the prompt can enter intermediate steps or final answers. This paper focuses on direct reproduction at inference time, not pretraining memory.
    • Existing gaps: The authors state that prior work mostly tests training-data extraction, or contextual privacy in final outputs and tool calls; research on CoT often ties to specific architectures or model-side interventions, lacking cross-family, budget-comparable token-level protocols.
    • Observation: The authors frame leakage as risk-weighted token events across 11 types of PII, and state that increasing the reasoning budget can either amplify or reduce leakage, depending on the base model.
    • Proposal: A model-agnostic measurement framework comparing open- and closed-source families, and evaluating four types of lightweight gatekeepers: rules, TF–IDF + logistic regression, GLiNER2, and LLM-as-judge.
    • Threat model:
      • Goal: Under the output-layer policy of "do not repeat PII," whether protected tokens reappear in the reasoning trace or final answer.
      • Knowledge: The paper specifies black-box: cannot view weights or hidden states, nor control training data.
      • Capabilities: Can modify prompts and possibly CoT budget; can also read stored traces, transcripts, or logs afterward.
      • Victim surface: Reasoning traces and answers returned by the assistant. Does not cover paraphrased or implicit leakage, cross-user extraction of training data, or strictly local architectures that do not log.
  2. What related research exists?

    Related work covers training-time extraction, contextual privacy, CoT safety surfaces, and detectors; this paper performs cross-family black-box measurement.

    Training-time extraction

    • Carlini et al. (2021, 2022) and Nakka et al. (2024) PII-Scope: quantify models regurgitating memorized PII, and how extraction rates vary with attack hyperparameters and model scale.

    Contextual privacy

    • Huang et al. (2022), Mireshghallah et al. (2023): discuss whether sensitive information provided at inference time appears in final outputs or downstream calls.
    • Wang et al. (2025) PrivacyChecker: applies contextual-integrity policies to agent traces and tool calls. The authors state that such gatekeepers can be expensive or tied to specific technology stacks.

    CoT as a security and privacy surface

    • Wei et al. (2022) use CoT to elicit step-by-step reasoning. Kuo et al. (2025) H-CoT, Jiang et al. (2025) SafeChain, Arnav et al. (2025), Guan et al. (2024) discuss that structured reasoning can be used for jailbreaks or constrained to guide safer behavior.
    • Green et al. (2025) Leaky Thoughts, Batra et al. (2025) SALT, Das et al. (2026) Chain-of-Sanitized-Thoughts, Wen et al. (2025) CoTGuard: measure reasoning trace leakage, or use steering, fine-tuning, or sanitization on CoT. The authors state that these works mostly evaluate specific architectures or model-side interventions; this paper instead uses a cross-family black-box approach, examining token-level phenomena and budget interactions.

    Inference-time detection and positioning of this paper

    • Production pipelines often combine regex, NER, and classifiers. Zaratiana et al. (2024, 2025) GLiNER can serve as a cross-domain PII detection backbone; LLM-as-a-judge is used for privacy and policy evaluation of free text (Mireshghallah et al., 2023).
    • Baselines and data: The leakage comparison is plain prompting (disabling thinking mode when available, otherwise no CoT prompt) versus explicit CoT. Data is the 11-type subset of PII Masking 200k. The authors did not use BigCode PII because of PII label mismatches and because PII Masking data is sufficient. Gatekeeper comparisons are the four detector types above.
    • The authors position this paper on a unified, reproducible, budget-aware protocol: measuring contextual PII directly entering CoT and answers, and comparing lightweight, model-agnostic detectors, rather than doing steering or fine-tuning.
  3. How does the paper address this problem?

    Uses risk-weighted token leakage of 11 categories of PII to compare plain with CoT and four types of lightweight gatekeepers.

    Figure 1 divides the pipeline into Injection, Retrieval, and Gatekeeper: first measure direct CoT leakage under a fixed output policy, then have lightweight detectors flag PII in the traces.

    Problem setting and leakage definition

    • Direct leakage: A canonical segment annotated in the input, after normalization, reappears in the reasoning trace or answer and is counted once. The appendix states full match against the gold standard, case-insensitive and whitespace-removed. The authors claim that in their setting, models always leak complete PII at the token level, not fragments.
    • Not counted: Paraphrased or implicit leakage, cross-user extraction from training data, and strictly local assistants that do not log.
    • Interface: Both the reasoning trace and the final answer are leakage surfaces. The attacker is black-box, can modify prompts, and may modify the budget.

    Data and risk tiers

    • Data from PII Masking 200k. The paper states the set has 209k synthetic, human-validated texts with 54 PII types; this paper uses 11 types.
    • Group A (mild): name, sex, job title, company name. Group B (medium): date of birth, IP, MAC, phone number, personal email. Group C (high risk): credit card number, social security number.
    • Tiers are based on the authors' defined leakage risk; for example, they consider credit card numbers higher risk than job titles.

    Injection, retrieval, and budget

    • Injection: For each of the 11 types, templates place PII as context in the prompt. Templates are in the appendix; wording is not repeated here.
    • Retrieval: Plain directly asks for relevant information; CoT uses what the paper calls a hijacking prompt, requiring step-by-step reasoning and answering in JSON with Steps and final_answer. Full templates are in the appendix.
    • Model families tested: Claude Opus, GPT o3 (closed-source), Llama 3.3:70B, DeepSeek-R1:70B, Qwen3:32B, Mixtral 8×22B (open-source). Generation temperature is 0.0. Plain disables the thinking mode flag when available, otherwise omits the CoT prompt.
    • Budget: Token limits are 0, 138, 345, 690, 1035. 0 means CoT disabled. Opus was not included in this comparison due to the API minimum of 1024 tokens.

    Four types of gatekeepers

    • Rules: Surface pattern matching per Table 2, such as emails with @, SSNs with hyphens, credit card numbers with 12–19 digits, and patterns for phone, MAC, IP, and dates.
    • Lexical classifier: Binary logistic regression trained on 2,220 balanced samples (11 types × 110 prompts), with TF–IDF features. Positive examples retain the original text with embedded PII; negative examples remove the PII strings. Appendix D.2 specifies uni-/bigrams, up to 5,000 features, L2 (C=1.0), LBFGS, up to 1,000 iterations.
    • GLiNER2: A 205M-parameter general information extraction model. Each PII type is paired with a small set of semantically related labels; any matched fragment above a fixed confidence threshold is flagged as leakage. Appendix D.3 states the threshold is 0.4 and specifies zero-shot.
    • LLM-as-judge: Another LLM judges whether the main model leaks in its reasoning. The authors observed that judges in development would restate audit instructions and write long outputs, potentially causing secondary leakage; they ultimately chose GPT-o4-mini and constrained output with a short, delimited user message. The same protocol also evaluates Claude Opus as a judge. Appendix D.4 and D.5 have full prompts; prohibitions, risk words, or example outputs are not listed here. The prompt in Appendix D.5 has its own risk grouping, whose members do not fully align with the main text's Group A/B/C. Both are set to temperature=0, max_tokens=1000.

    Metrics

    Risk-weighted F1 is the weighted average of per-class F1, F1risk=∑k=1n wk F1k/∑k=1n wk, with weights wA=1, wB=3, wC=9; the paper states it uses a geometric progression rather than a linear scale to emphasize Group C. Recall is the proportion of sensitive tokens in the prompt that are leaked in the output. Macro-F1 treats all classes equally. SPriv is the proportion of sensitive tokens in the generated text that remain unmasked, with 0 meaning fully masked; it is normalized by output length, while Recall is normalized by the number of sensitive tokens in the prompt.

  4. What experiments did the paper conduct?

    The authors state that average leakage rates range from 52.3% to 86.3%; no single gatekeeper dominates across all models.

    Experimental Setup

    • Models: Llama 3.3:70B, Claude Opus, Mixtral 8×22B, Qwen3:32B, DeepSeek-R1:70B, GPT o3 (Table 8 writes O3 v2025-04-16). Temperature 0.0. Open-source on a single A100-80GB; closed-source via hosted APIs; some Llama 3.3 via IONOS Model Hub.
    • Data: 11-type subset of PII Masking 200k. Main leakage experiment: 100 runs per PII label and per prompting method.
    • Comparison: plain vs. explicit CoT. Budget experiment token limits: 0, 138, 345, 690, 1035, six types of PII (name, job type, phone, dob, SSN, credit card), 5 prompts per type, seeds 42, 123, 999.
    • Sample size: The text states a total of 2,550 runs, 450 per model, and excludes Opus due to its API minimum of 1024 tokens; Table 8 and Appendix Table 9 are for 5 models, totaling 2,250 runs. Figure 3 lines are medians of 90 runs, with shadows as interquartile ranges.
    • Gatekeepers: Rules, TF–IDF + logistic regression, GLiNER2 (threshold 0.4), GPT-o4-mini and Claude Opus as LLM-as-judge. Appendix Table 16 states 1,100 samples per model (11 types × 100).
    • Metrics: Normalized full match; leakage frequency, Recall, Macro-F1, risk-weighted F1, SPriv. Table 4 gives six-model means and [5%, 95%] intervals. The paper does not report agreement with human annotations.

    Main Results

    Swipe horizontally to read the table

    ModelPlain AverageCoT AverageΔAmp (percentage points)
    Llama 3.356.45%99.09%42.64
    Claude Opus45.82%85.00%39.18
    Mixtral92.45%99.45%7.00
    Qwen364.82%93.64%28.82
    DeepSeek-R137.45%77.00%39.55
    GPT o316.82%63.73%46.91

    From Table 3. Each cell is the average leakage frequency over 11 types, 100 runs each; ΔAmp is CoT minus plain in percentage points.

    • The authors state that the average leakage rate across architectures and categories is 52.3% for plain and 86.3% for CoT, a difference of +34.0 percentage points, with a median CoT leakage of 100%. This is a re-averaging of the six-model averages, not a row in Table 3.
    • The authors report Group A 98.3%, Group B 89.3%, Group C 55.0%, and state that models treat Group C as more sensitive, but leakage remains substantial; the paragraph does not specify whether it is CoT-only or aggregated across conditions. In Table 6, high-risk categories do not uniformly increase: Opus's credit card is 0 for both plain and CoT, DeepSeek-R1's CoT credit card is 1, Mixtral's SSN goes from 98 to 97. Llama's email goes from 1 to 100, SSN from 4 to 100, credit card from 0 to 91. Figure 7 axis is labeled CoT - Plain Leakage (%), but the caption says leakage rate under CoT; several cells match differences in Table 6, such as Llama email 99 and Mixtral SSN -1.
    • The authors state that o3 outperforms the other five models on both plain and CoT. In Figure 6, at a 5% tie threshold, o3's net wins against other models are all positive: 11 against Mixtral for plain, 9 against Llama, Mixtral, Qwen3 for CoT, 7 against Opus, and 5 against DeepSeek-R1. The authors state that among open-source models, DeepSeek-R1 differs from o3 by 13.3 percentage points; Table 3 CoT averages are 77.00% and 63.73%. The text states that Llama and Mistral have average leakage rates of 99%, and that Mistral is the most unsafe open-source model in this evaluation; the corresponding name in the table is Mixtral.

    Reasoning Budget

    • Table 8 at limit 0: DeepSeek-R1 46.7%, Llama 3.3 26.7%, Mixtral 73.3%, o3 2.2%, Qwen3 45.6% (each 90 runs). At limit 138, except o3 (0.0%), DeepSeek-R1 53.3%, Llama 46.7%, Mixtral 93.3%, Qwen3 93.3%.
    • o3 at 345, 690, 1035: 14.4%, 48.9%, 56.7%. The authors state that o3 rises from near 0 to 53%, and is the only model affected by seed; the endpoint at 1035 in the table is 56.7%. The authors state that DeepSeek-R1 and Llama's thinking impact is +6.7% and +20%, relatively stable between 138–1035; in the table, DeepSeek-R1 at 690 is 50.0%, lower than 53.3% at 138, 345, and 1035.
    • The authors state that except for o3, leakage increases from no thinking to enabled reasoning, with Mixtral and Qwen3 exceeding 90%. In Table 8, Qwen3 is 86.7% at 690 and 1035. The five-model total leakage rate goes from 38.9% at limit 0 to 67.3% at 1035. The authors state that most models plateau once given budget, while o3 continues to rise with budget.

    Gatekeepers

    • Table 4 is detection metrics, not post-gating model leakage rates; residual leakage is in Figure 4 (blue bars total leakage, orange bars post-gating), but the text does not give bar heights that align cell-by-cell with the table. Six-model averages: LLM-Opus Recall 0.848 (interval [0.727, 0.955]), Macro-F1 0.854; GLiNER2 risk-weighted F1 0.841, SPriV 0.0010. Rules are 0.632 and 0.0248, TF–IDF classifier 0.310 and 0.0117, o4-mini Recall 0.492, risk-weighted F1 0.682, SPriV 0.0201.
    • The authors state that optimizing Recall is not the same as optimizing privacy risk: Opus judge catches more tokens, GLiNER2 is more aligned with Group C. The authors state that rules expose 2.5% and GLiNER2 exposes 0.1%, a 25-fold difference in leakage density; Table 4 corresponding SPriV values are 0.0248 and 0.0010.
    • Table 5 and Table 10: The best detector varies with the tested model. LLM-Opus risk-weighted F1 on Llama and Mixtral is 0.998 and 0.995, on DeepSeek-R1 it is 0.256. On DeepSeek-R1, rules are 0.637 and GLiNER2 is 0.619. On o3, GLiNER2 is 0.933 and o4-mini is 0.876. On Opus outputs, GLiNER2 is 0.668 and Opus judge is 0.566. The authors state there is no single winner across targets, and that DeepSeek-R1's long reasoning chains put PII into semantically rewritten context; this is the authors' explanation, not a separate causal experiment.

    Other Ablations and Analyses

    • Table 1 average generated tokens: Mixtral 101, Llama 3.3 167, Opus 191, o3 337, Qwen3 449, DeepSeek-R1 565; the authors state a 5.6-fold difference, and the ordering is consistent across 11 types.
    • The authors state that Name, Job Type, Company Name generate fastest, while IP, MAC, credit card are slowest; the paper does not give per-type times.
    • The authors state that o3 returns internal reasoning that cannot be shared with the user 35% of the time, rather than a mandatory thinking step.
    • The authors state that safety markers in the tested Claude 4 responses are ineffective, not activated in any of the 100 trials.
    • The lexical classifier's risk-weighted F1 is 0.500 on Mixtral and 0.118 on DeepSeek-R1 (Table 10).
    • Appendix Table 7 gives retrieval accuracy by type: credit card 41.8%, SSN 68.3%, phone 82.2%, gender 99.8%; the table does not specify which model, or whether it is a six-model average.
  5. What are some points that can be further explored?

    The authors state they only test verbatim reproduction on English synthetic data and did not test adaptive attacks or non-verbatim leakage.

    Limitations and future directions noted by the authors

    • Narrow threat surface: Only tests direct reproduction of contextual PII in black-box, inference-time settings; does not cover training-data extraction, membership inference, latent attribute disclosure, cross-user leakage via weights, caches, or logs, and abstracts away deployment-side logging and access controls (Limitations).
    • Data and interaction: Experiments use English synthetic, human-validated PII and hand-written injection and retrieval prompts; no free multi-turn dialogue, non-PII sensitive attributes (e.g., health, political opinions), or multimodal inputs (Limitations). Ethical Considerations lists cross-language, cross-population, and cross-domain leakage differences as future directions.
    • Attack setting: Single-turn queries, discrete CoT budget. The authors believe this may underestimate worst-case leakage under adaptive adversaries, while relatively constrained interfaces may overestimate it (Limitations).
    • Detectors: Evaluated six contemporary models, a small budget, and the gatekeepers in the paper; did not test richer contextual-integrity gatekeepers, did not train on deployment logs, did not calibrate judges with large-scale human annotations, and did not perform adversarial attacks on gatekeepers (Limitations).
    • Traces and explanations: Measures which tokens are exposed, not whether explanations are faithful to internal reasoning (Limitations).
    • Outlook: Conclusion lists uncertainty-aware, risk-controlled CoT release, more robust style-adaptive LLM judges, paraphrased or latent CoT, split-reasoning that keeps sensitive steps local, and a shared budget-aware direct-leakage benchmark. The three risk tiers are written as a practical abstraction for measurement; deployment requires reweighting according to local policies (Ethical Considerations).

    Experimental coverage

    • The main leakage experiment covers six models, 11 PII types, plain and CoT, 100 runs per cell, temperature 0.0 (Section 3.1, Table 6).
    • Budget curves cover five models in Table 8, five token limits, six PII types, and three seeds; Claude Opus was not included in that table due to the API minimum of 1024 tokens.
    • Gatekeepers cover rules, TF–IDF + logistic regression, GLiNER2, GPT-o4-mini, and Claude Opus judge, with metrics including Recall, Macro-F1, risk-weighted F1, and SPriv (Table 4, Table 10).
    • Commercial interfaces only recorded Claude 4 safety flags (not activated in 100 runs) and o3 not returning thinking steps 35% of the time.
    • The paper does not report agreement between gatekeeper judgments and human annotations, nor detection rates under adaptive attacks; Limitations states these two were not done.
  6. Summarize the main content of the paper

    The authors state that CoT increases verbatim leakage and that it varies with model and budget; detectors also need to be selected per model.

    Under the output policy of "do not repeat PII," this paper uses a black-box protocol to measure whether PII in the prompt is written back into the CoT and the answer, and compares lightweight gatekeepers.

    • Problem: CoT adds an inference-time leakage surface. Leakage is defined as the reappearance of normalized canonical segments across 11 types of PII, weighted by mild, medium, and high risk.
    • Approach: Compare plain prompting with explicit CoT on a PII Masking 200k subset, then sweep token limits from 0 to 1035. Detectors are rules, TF–IDF + logistic regression, GLiNER2, and two judges: GPT-o4-mini and Claude Opus.
    • Leakage: The authors state that across six models and categories, the average leakage rate rises from 52.3% with plain prompting to 86.3% with CoT (+34.0 percentage points). In Table 3, o3's CoT average is 63.73%, Llama 3.3 is 99.09%, and Mixtral is 99.45%. Opus's credit card remains 0 under CoT (Table 6).
    • Budget: In Table 8, except for o3, leakage rates increase when the limit goes from 0 to 138 and mostly plateau; o3 is 0.0% at 138 and 56.7% at 1035. Qwen3 is 86.7% at 690 and 1035, lower than 93.3% at 138.
    • Detection: In Table 4, LLM-Opus has an average Recall of 0.848, GLiNER2 has an average risk-weighted F1 of 0.841 and SPriV of 0.0010. The same Opus judge on DeepSeek-R1 has a risk-weighted F1 of 0.256 (Table 10).
    • Authors' conclusion: CoT release should not be considered safe by default; defenses need to be mixed per model and budget, rather than using a single detector. The Outlook also lists non-verbatim leakage and architectures that keep sensitive steps local.
Read originalarxiv.org