Here is a concise, engaging blog-style summary of the paper.
TL;DR
This paper introduces EchoCoT, a novel multi-step attack framework that extracts hidden chain-of-thought (CoT) reasoning traces from black-box Large Reasoning Models (LRMs) near-verbatim. By exploiting a previously overlooked "replay surface" inherent to tool-calling mechanics, the authors demonstrate that proprietary reasoning steps can be systematically recovered using only standard API interactions and basic metadata signals.
What Problem Does This Paper Address?
Frontier Large Reasoning Models (like OpenAI's o1/o4-mini or Google's Gemini Thinking) generate internal, step-by-step textual chains-of-thought before producing a final answer. These hidden CoTs are highly valuable proprietary assets used for model distillation, safety monitoring, and diagnosis. Consequently, providers strictly protect them from user exposure.
While prior work attempted to reconstruct or guess these paths, it remained unclear whether an attacker could extract the exact, near-verbatim hidden reasoning trace from a black-box model via a standard API. This paper tackles that gap, revealing a critical security risk in how models maintain state during complex tasks.
Methods
The core innovation relies on exploiting the reasoning continuity required during tool calls. While standard multi-turn conversation contexts often discard or sanitize previous reasoning tokens to save space or protect privacy, providers must preserve the internal reasoning state across function or tool calls within a single user-assistant turn to maintain task continuity.
The authors design EchoCoT, which operates as follows:
- The Replay Surface: The attacker prompts the model to solve a problem and archive its reasoning using a custom "scratchpad tool."
- Iterative Injection: The initial archival is usually highly compressed. The attacker intercepts the tool call, rejects the response, and injects malicious instructions pressing the model to reproduce its internal thinking block more completely.
- Automated Optimization: To avoid manual prompt engineering, the authors build an LLM-based optimization framework driven by an Inject-Reflect-Distill workflow. It automatically searches for a universal injection trajectory across batches of questions, guided only by proxy signals like reported reasoning token counts and optional compressed summaries.
The high-level attack pipeline is illustrated below:
The automated framework for optimizing these trajectories is shown here:
Datasets
The injection trajectories were optimized and evaluated using reasoning problems sampled from:
- OpenThoughts: Used as the primary dataset for optimization and testing, spanning nine distinct domains (including mathematics, coding, biology, chemistry, and physics).
To evaluate cross-dataset transferability, the optimized trajectories were tested on three unseen benchmarks:
- MATH500 (Mathematics)
- JEEBench (Advanced Science/Math)
- LiveCodeBench (Coding)
Key Insights and Ideas
- Tool Calling is a Security Double-Edged Sword: The very mechanism that allows LRMs to perform complex, multi-step tool interactions forces them to keep their raw, unredacted reasoning state accessible in memory, creating a vulnerable "replay surface."
- Seemingly Safe Metadata is Enough for Optimization: Attackers do not need access to weights or logits. Simple API-returned metadata—such as the exact number of reasoning tokens consumed or a highly compressed summary—provides a strong enough reward signal for an automated optimizer to find near-verbatim extraction prompts.
- Multi-Step Interaction is Essential: A single tool call or prompt injection yields zero successful near-verbatim extractions. High-fidelity recovery only begins to emerge during the second and third iterations of rejection and pressure.
Key Results
The authors evaluated EchoCoT against three open-source models (DeepSeek-V4-Flash, Qwen3.5-Plus, GLM-5.2) and five frontier proprietary models (Gemini-2.5, Gemini-3.1, Gemini-3.5, Claude 3.5 Sonnet-4.6, Claude 3.5 Opus-4.6).
- Open-Source Models: EchoCoT achieved up to a 66.4% Attack Success Rate (ASR@90), meaning the extracted trace length was within 10% of the target and matched at least 90% of the tokens exactly. Baseline methods achieved near 0% success under this strict verbatim metric.
- Proprietary Models: Even without ground-truth verification, proxy metrics indicated high-fidelity extraction. For example, on Gemini-2.5, EchoCoT successfully extracted a massive 33,463-token chain-of-thought from a target reported by the API to be 32,948 tokens.
- Qualitative Discoveries: The extracted chains revealed fascinating internal model behaviors, such as simulated Google searches, extensive self-correction, and sudden language-switching (e.g., a model switching to Chinese to recall a specific textbook context).
- System Prompt Leakage: Beyond extracting reasoning, the framework occasionally triggered broader context dumps, successfully leaking the hidden system prompts of models like OpenAI's o4-mini.
Limitations and Future Work
- Proxy Evaluation for Frontier Models: Because frontier providers completely hide the raw CoT, quantitative evaluation on proprietary models relies on proxy metrics (length matching and summary entailment) rather than direct token-to-token comparison.
- Defenses: The authors tested several practical defenses, finding that while removing reasoning token counts or adding defensive system prompts helps mitigate the risk, they do not fully prevent adaptive attacks.
- Future Directions: The paper highlights an urgent need for more robust architectural defenses, such as post-training safety alignment specifically tailored to tool-calling states, or complete reasoning state isolation during external interactions.
Summary updated