Featured image of post Turning off the vendor's scratchpad and handing the model a new one: A naive\nattack method for AI reasoning extraction

Turning off the vendor's scratchpad and handing the model a new one: A naive attack method for AI reasoning extraction

The author Oh My Pi used an external tool to bypass the hidden reasoning protections of GPT-5.6 and Fable 5, exposing not just the thinking process but also API credentials

Vendors Locked the Front Door but Forgot the Window

Large model vendors have an unspoken agreement: the raw reasoning process is kept out of sight. OpenAI, Anthropic, and Google only return a “summary of thoughts” or a chunk of encrypted data via the API, allowing you to pass it back as-is to maintain context, but rendering it completely unreadable.

The rationale is sound—the raw reasoning might contain API keys, email addresses, access tokens, or even login private keys. Vendors encapsulate the reasoning into opaque data blocks, blocking the “direct read” path.

Example of encrypted reasoning data returned by vendors

But this wall only seals off one exit. The model’s inherent reasoning capability isn’t turned off; it’s just driven into a hidden passage. As long as the model can still think, it will find a place to write out its thoughts—even if you hand it a fresh piece of scratch paper.

The Simple Bypass: Give It a Tool

The method is so simple it hardly qualifies as an attack: turn off the vendor’s hidden reasoning feature, and attach an external tool called deep_think to the model—with only one parameter for text input. The model proactively writes its analysis into the tool parameter before answering, and the tool parameter is returned to the developer in plaintext via the API.

No cracking encryption, no attacking the model, no exploiting vulnerable code. You lock the front door, I slip a piece of paper through the window, and the model starts writing on its own.

This path works because the model can’t distinguish between an “internal reasoning channel” and an “external tool call” in terms of semantics—to the model, both are places to express thoughts. The vendor closes the former, and the latter becomes a natural exhaust vent.

Two Paths: Extraction vs. Reconstruction

This direction actually has academic precedent. Alexander Panfilov et al.’s paper, Stealing Reasoning Traces from Proprietary LLM APIs, proves that encrypted reasoning data returned by vendors can be “decoded” by another model: feeding the encrypted data to a weaker, less-protected model from the same vendor allows it to re-output the reasoning hidden in the encrypted block as plain text. The paper also found that extracting certain reasoning fragments from Claude and GPT via Kimi-K3 is nearly 1 million times easier than via other models.

Even more dangerous is the “injection attack”: first, a weak model writes malicious instructions into the encrypted reasoning data, which is then passed to a strong model. The strong model treats it as its own previous thoughts and executes it while the user remains completely blind to the malicious instructions—an implicit form of prompt injection.

But this path has a prerequisite: the encrypted reasoning data must flow across multiple requests. The tool parameter method skips this prerequisite entirely—what it captures isn’t the original reasoning record, but a fresh analysis draft written by the model on the spot, which may be even closer to the model’s true internal reasoning.

Three Experiments

Tested on GPT-5.6 Luna: given a number theory problem requiring extensive deduction (Vieta transformations, proposition evaluation for Markov triple graphs), the model still proactively called deep_think and wrote out a dense, detailed analysis in the parameter after native reasoning was disabled.

Full reasoning process of GPT-5.6 Luna calling the deep_think tool

This content isn’t a polished, user-facing explanation; it’s a “caveman language” composed of short fragments, abbreviations, and jumpy expressions—a shorthand draft meant only for the model itself. Toggling the reasoning level (off/low) kept the method effective. The reasoning level is essentially just a number in the system prompt; changing this number can influence how much reasoning the model invests, without needing to reactivate the vendor’s hidden channel.

It works equally well on Claude Fable 5—even with the reasoning level set to off, the model still went step-by-step inside the external tool, checking propositions, calculating examples, and structuring proofs. Anthropic is usually adept at intercepting such content with regex rules, but this time the reasoning process leaked out through another exit.

Claude Fable 5 writing out its reasoning process in an external tool

The Security Paradox: The More Complex the Lock, the More It Fears the Simplest Key

The most noteworthy aspect here isn’t the method itself, but the security paradox it reveals.

Vendors invest heavy engineering into encrypting reasoning data: opaque data blocks, user isolation, session binding, and model binding. But these protective measures rest on the premise that “reasoning can only flow out through vendor-specified channels.” Once a model gains the ability to call external tools—a standard feature in the Agent era—it gains an additional exit beyond the vendor’s control.

The more complex the security mechanism, the easier it is to bypass with the simplest approach. No matter how strong the encryption, the model will write its thoughts elsewhere. This isn’t something vendors can fix unilaterally—unless they forbid models from calling external tools entirely, which would be equivalent to severing the core capability of Agents.

Double-Edged Sword: Visible = Controllable, but Also = Leakable

For developers, being able to see the reasoning process is a good thing: locating errors, optimizing prompts, and understanding model decisions. Oh My Pi has already turned this method into an official feature, externalThinking; once enabled, Pi automatically prepares an “external scratch pad” for the model.

Oh My Pi externalThinking feature interface

But the risk is amplified accordingly. In its drafts, the model might write out source code, personal information, or even account credentials. Once this content enters tool parameters and runtime logs, it gets saved, copied, and forwarded—information originally hidden inside the model begins to be exposed to more people and systems.

From this moment on, the scope of AI security shouldn’t just be the model itself, but also the entire tool ecosystem surrounding it. Vendors might seal off a piece of hidden reasoning, but they can’t necessarily seal off every path the model takes to the outside world.

Direct Impact on Developers

If you’re building applications using the OpenAI/Anthropic/Google APIs, these three things are worth doing right now:

  • Audit tool parameter logs: Your Agent tool call logs might already be sitting on the model’s reasoning drafts; check who has permission to read these logs
  • Don’t flow reasoning data across sessions: Even if the vendor allows it, the path of passing encrypted reasoning data across users/models is an attack surface already proven by the paper
  • Add a line to your threat model: Assume attackers can read the model’s reasoning process—would API keys, connection strings, or internal logic potentially appear in the drafts

LynxHot · Tracking AI tools, models, and industry shifts