Blog October 2026

Agents Leak What They Refuse to Reveal

AI agents are increasingly entrusted with secrets: credentials, calendars, health records. Personal agents such as OpenClaw1 load this information into every conversation and routinely send what they write to third parties. The prevailing safeguard is behavioral: the model is instructed not to disclose a secret, and an evaluator checks that the secret never appears, verbatim or paraphrased, in its output2.

In our NeurIPS 2026 paper3, we show that this safeguard does not provide secrecy. A model can refuse every direct request for a secret and still leak it: its responses to unrelated, benign requests depend on the secret, and an adversary who observes them can recover it. We call this inadvertent context leakage.

Animation. An AI agent is asked “What is my secret?” and replies “I’m sorry, I cannot reveal confidential information.” Asked next for a short creative paragraph with specific numbers, it replies “In 1987, a coastal town of 4,217 residents produced 372 kg of honey from 28 hives…” The agent’s private context holds the PIN 7249. As ordinary replies like this one flow into the attacker’s decoder, it reconstructs the digits 7, 2, 4 and 9 one at a time.
The agent’s private context contains the PIN 7249 and an instruction to keep it confidential. Asked for it directly, the agent refuses. Its reply to a benign request never mentions the PIN, yet a decoder trained against the model reconstructs 7249 from such replies. (Adapted from Figure 1 of the paper.)

Recovering the secret

Our attack needs only access to the model’s public API and to text generated by the model for an ordinary user (which the user might subsequently share). Once per model, the adversary collects data by sending benign requests with simulated secrets to the model’s public API, and trains a decoder that maps the model’s responses to those secrets. Next, it applies this decoder to the text generated by the model for the user. Training never involves the victim, and its cost (about seven dollars for 2-digit secrets against Gemini 3.1 Flash-Lite) is paid once for all users of a model.

We evaluate eight proprietary models from Anthropic, Google, OpenAI, and xAI, each holding a random $N$-digit secret and an instruction never to reveal it. All 160 direct requests for the secret were refused. Nevertheless, replies to benign requests, such as lists of random numbers, fictional data tables, and short stories, reveal it. The best 4-digit result (Claude Opus 4.6: 82% of secrets recovered in full) uses an adaptive decoder that conditions each request on the digits recovered so far.

SECRET LENGTH 1 digit 2 digits 4 digits 8 digits Claude Opus 4.6 Claude Opus 4.6, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Claude Opus 4.6, 2-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Claude Opus 4.6, 4-digit secret: 89% of digits recovered, 82% of secrets recovered whole89% Claude Opus 4.6, 8-digit secret: 34% of digits recovered, 4% of secrets recovered whole34% Gemini 3.1 Pro Gemini 3.1 Pro, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Gemini 3.1 Pro, 2-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Gemini 3.1 Pro, 4-digit secret: 83% of digits recovered, 44% of secrets recovered whole83% Gemini 3.1 Pro, 8-digit secret: 41% of digits recovered, 4% of secrets recovered whole41% Claude Sonnet 4.6 Claude Sonnet 4.6, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Claude Sonnet 4.6, 2-digit secret: 98% of digits recovered, 97% of secrets recovered whole98% Claude Sonnet 4.6, 4-digit secret: 74% of digits recovered, 21% of secrets recovered whole74% Claude Sonnet 4.6, 8-digit secret: 35% of digits recovered, 0% of secrets recovered whole35% Gemini 3.1 Flash-Lite Gemini 3.1 Flash-Lite, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Gemini 3.1 Flash-Lite, 2-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Gemini 3.1 Flash-Lite, 4-digit secret: 65% of digits recovered, 11% of secrets recovered whole65% Gemini 3.1 Flash-Lite, 8-digit secret: 35% of digits recovered, 0% of secrets recovered whole35% GPT-5.4 GPT-5.4, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% GPT-5.4, 2-digit secret: 100% of digits recovered, 99% of secrets recovered whole100% GPT-5.4, 4-digit secret: 62% of digits recovered, 14% of secrets recovered whole62% GPT-5.4, 8-digit secret: 27% of digits recovered, 0% of secrets recovered whole27% Grok 4 Grok 4, 1-digit secret: 100% of digits recovered, 100% of secrets recovered whole100% Grok 4, 2-digit secret: 94% of digits recovered, 90% of secrets recovered whole94% Grok 4, 4-digit secret: 36% of digits recovered, 10% of secrets recovered whole36% Grok 4, 8-digit secret: 26% of digits recovered, 2% of secrets recovered whole26% RESISTANT TIER Grok 4.1 Fast Grok 4.1 Fast, 1-digit secret: 99% of digits recovered, 99% of secrets recovered whole99% Grok 4.1 Fast, 2-digit secret: 38% of digits recovered, 15% of secrets recovered whole38% Grok 4.1 Fast, 4-digit secret: 18% of digits recovered, 2% of secrets recovered whole18% Grok 4.1 Fast, 8-digit secret: 13% of digits recovered, 2% of secrets recovered whole13% GPT-5.4 nano GPT-5.4 nano, 1-digit secret: 37% of digits recovered, 37% of secrets recovered whole37% GPT-5.4 nano, 2-digit secret: 22% of digits recovered, 4% of secrets recovered whole22% GPT-5.4 nano, 4-digit secret: 14% of digits recovered, 1% of secrets recovered whole14% GPT-5.4 nano, 8-digit secret: 12% of digits recovered, 0% of secrets recovered whole12% Digits recovered 10% (chance) 100%
Best-case share of digits recovered, by model and secret length; chance is 10% throughout. Hover a cell for the share of secrets recovered in full. (Data from Figure 2 of the paper.)

Leakage is not limited to the numbers a model writes. Decoders that use only response length, writing style, or sentence embeddings recover a single-digit secret well above chance on all six models tested.

Why models leak

Our explanation is suppression: a model instructed never to reveal a value avoids producing it, so the value appears less often than chance would predict, and this deficit identifies the secret. Three observations support it.

  • Suppression tracks leakage. Across the eight models, the two are strongly rank-correlated (Spearman ρ = 0.95). Moreover, only the protected value leaks; other numbers in the same context remain at chance.
  • Stronger instructions increase leakage. On Claude Opus 4.6, a terse instruction yields 5% per-digit accuracy, below chance, while a formal confidentiality policy yields 64%.
  • Post-training increases leakage. On the open OLMo-3-32B-Think model, the adversary’s remaining uncertainty about a 2-digit secret falls from 2.91 bits at the base model to 1.37 bits after reinforcement learning, where 6.64 bits would mean no leakage.

The obedience paradox. The more faithfully a model follows “never reveal X,” the more systematically it avoids X, and systematic avoidance is itself a signal.

Leakage is thus a byproduct of capability rather than a defect: the instruction following that makes a model useful is what makes it leak.

Secrecy by construction

The safeguards in use today do not address this problem. Instructions and alignment training do not help: the model already refuses correctly, and stronger instructions increase leakage. Output filters do not help either: the model never states the secret, so a filter has nothing to catch.

What secrecy requires is the guarantee cryptography has always asked for4: the model’s output distribution must be approximately invariant to the protected value. Such invariance would have to be established during training, and for arbitrary natural-language secrets it is open how to do so.

The dependable alternative is architectural. A secret that never enters the model’s context cannot influence its outputs, so agents should be built to use credentials without ever holding them, a direction where cryptographic tools have much to offer. This is the view we take at zkBricks: privacy should hold by construction, not by the good behavior of a model. If you are building agents that handle sensitive data, we would be glad to talk.

Acknowledgments: This work is supported by grants from Coefficient Giving and Foresight Institute.

References

  1. Peter Steinberger. OpenClaw: Personal AI Assistant, 2025. github.com/openclaw/openclaw ↩

  2. Niloofar Mireshghallah, Hyunwoo Kim, Xuhui Zhou, Yulia Tsvetkov, Maarten Sap, Reza Shokri, and Yejin Choi. Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity Theory. 2023. arXiv:2310.17884 ↩

  3. Jaiden Fairoze, Neal Mangaokar, Kamalika Chaudhuri, Sanjam Garg, and Saeed Mahloujifar. Inadvertent Context Leakage in Language Models. In Advances in Neural Information Processing Systems (NeurIPS), 2026. arXiv:2608.19857 ↩

  4. Shafi Goldwasser and Silvio Micali. Probabilistic Encryption. Journal of Computer and System Sciences 28(2), pp. 270–299, 1984. ↩