EchoCoT: Extracting Hidden Chain-of-Thought from Large Reasoning Models
This paper introduces EchoCoT, a multi-step attack framework that successfully extracts hidden chain-of-thought traces near-verbatim from both open-source and frontier proprietary large reasoning models via API interactions, demonstrating a significant security risk to these valuable model assets.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Modern artificial intelligence systems have become remarkably skilled at solving complex problems, from writing computer code to navigating scientific puzzles. When these advanced models tackle a difficult question, they do not simply spit out a final answer. Instead, they first generate a long, internal stream of thought, a step-by-step reasoning process where they explore ideas, check their work, correct mistakes, and consider different paths before settling on a conclusion. This internal monologue, often called a chain of thought, is usually hidden from the user. The model keeps this reasoning private, showing only the final result to protect its intellectual assets and prevent the exposure of sensitive data or proprietary logic. For developers, this hidden reasoning is a valuable resource for improving future models, while for users, it is a black box that promises a correct answer without revealing the messy work behind it.
A team of security researchers at CISPA Helmholtz Center for Information Security has discovered that this hidden reasoning is not as secure as once believed. They found a way to trick these advanced models into revealing their entire internal thought process, almost word for word, even when the models are designed to keep it secret. The researchers developed a method called EchoCoT, which exploits a specific quirk in how these models interact with external tools. In many systems, when a model needs to use a tool—like a calculator or a database—it pauses its reasoning to make the call, but it keeps its previous thoughts active in its memory to ensure continuity. The researchers realized that an attacker could use this continuity to their advantage. By repeatedly asking the model to save its thoughts to a tool and then rejecting those saved thoughts as incomplete, they could force the model to replay its internal reasoning, each time revealing more detail until the full, hidden chain of thought was exposed.
The researchers tested this technique on a variety of models, including both open-source systems and the most advanced, proprietary models from major technology companies. On the open-source models, where the researchers could compare the extracted thoughts against the original hidden ones, they found that EchoCoT could recover nearly the entire reasoning process. In many cases, the extracted text matched the original hidden thoughts with extreme precision, capturing over 90 percent of the exact words and phrases. The method worked even for very long reasoning chains, successfully extracting thousands of tokens of thought. When the researchers applied the same technique to the proprietary models from companies like Google and Anthropic, they could not see the original hidden thoughts to compare them directly. However, the extracted thoughts were incredibly long, often matching the length of the reasoning the companies reported the models had used. Furthermore, the content of these extracted thoughts aligned closely with the brief summaries the companies provided, suggesting the extraction was accurate. In one instance involving a Google model, the researchers recovered a reasoning chain of over 33,000 tokens, which was nearly identical in length to the model's reported internal process.
Beyond just recovering the text, the extracted thoughts revealed rich details about how these models think. The researchers observed the models simulating Google searches, switching between different languages like Chinese and English while recalling information, and engaging in extensive self-correction. These behaviors, such as a model saying "Wait, is this true?" or "Let me try a different approach," are part of the raw internal process that is typically stripped away before the final answer is shown to a user. The study also showed that the attack could be automated. The researchers built a system that could learn the best way to ask for the thoughts, refining its questions based on feedback signals like the number of words the model used. This automated approach made the attack even more effective, allowing it to generalize across different types of questions and datasets without needing to be manually reprogrammed for each new problem.
The implications of this discovery are significant for the security of artificial intelligence. The researchers found that simply hiding the reasoning from the user is not enough to protect it. As long as the model retains its internal state to perform tasks that require tool use, that state can be replayed and extracted. The study tested several potential defenses, such as hiding the count of reasoning words or adding strict instructions to the model's system prompt to prevent leakage. While some of these measures reduced the success of the attack, none completely stopped it. The most effective defense tested was to remove the model's access to its own previous reasoning after a tool call, but this would break the model's ability to perform complex, multi-step tasks. The researchers responsibly reported their findings to the major technology companies involved, highlighting a critical vulnerability in the current design of these powerful reasoning systems. Their work suggests that protecting the intellectual property and safety of these models will require more fundamental changes to how they are built and how they interact with the outside world, rather than just relying on the assumption that hidden thoughts remain hidden.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.