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.
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.
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
-
Peter Steinberger. OpenClaw: Personal AI Assistant, 2025. github.com/openclaw/openclaw ↩
-
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 ↩
-
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 ↩
-
Shafi Goldwasser and Silvio Micali. Probabilistic Encryption. Journal of Computer and System Sciences 28(2), pp. 270–299, 1984. ↩