Can Your Research Agent Keep a Secret? Every Query Looks Harmless, Together They Leak
ServiceNow's MosaicLeaks turns the vague worry about research agents leaking into a measurable property. An adversary never sees the private documents or the agent's reasoning, only the cumulative outbound query log, yet can reassemble a chain of harmless web queries into a fact that lived only in internal documents. That is the mosaic effect. The most counterintuitive finding: training only for task performance makes leakage worse. ServiceNow's PA-DR method shows privacy has to go into the training objective, raising strict chain success from 48.7% to 58.7% while cutting answer and full-information leakage from 34.0% to 9.9%. The judgment for builders: agent data exfiltration is an engineering and training-objective problem, not an alignment slogan you fix with a do-not-leak prompt.
Summary
On June 18 ServiceNow published MosaicLeaks on the Hugging Face blog, and it answers a question that had been stuck at the level of intuition: when a research agent combines private internal documents with web retrieval, does it leak secrets in the course of doing its work? That used to be a vague worry. It is now a property you can measure hop by hop and train back down.
The mechanism is the mosaic effect. Any single outbound web query looks harmless on its own, but accumulated together they let an observer who sees only the query log reassemble facts that exist only in private documents. The most counterintuitive result: reinforcement learning that targets only getting the task right makes leakage worse, not better. ServiceNow’s training method, PA-DR, shows privacy is fixable only when it enters the training objective. Strict chain success (the share of chains where every hop is answered correctly) rises from 48.7% to 58.7% while answer and full-information leakage falls from 34.0% all the way to 9.9%.
What happened
MosaicLeaks is a benchmark of 1,001 multi-hop research chains. Each chain interleaves sub-questions over local enterprise documents with sub-questions over a controlled web corpus, and the design hinges on one thing: the answer to one sub-question becomes a bridge entity in the next, so the agent must retrieve local information before it can form the next useful web query. Local documents come from DRBench-style enterprise tasks, and web documents come from BrowseComp-Plus. The final split is 559 training chains, 98 validation chains, and 344 held-out-company test chains, so the test set runs on company contexts never seen during training.
The threat model is deliberately narrow, and that is what makes it sturdy. The adversary cannot see the private documents and cannot see the agent’s reasoning. The only thing visible is the cumulative outbound query log, from which the adversary tries to infer private enterprise information. The log is the leakage channel, and nothing else is assumed.
Leakage is measured in three increasing levels of concern. Intent leakage: the adversary can infer what the agent is investigating and what its goals are. Answer leakage: the adversary already holds a question about private information, and the query log carries enough to answer it. Full-information leakage is the strongest: without being told what to look for, the observer can discover and state verifiably true private facts straight from the log.
The MediConn example from the paper makes the mechanism concrete. One query asks what percent of MediConn’s on-premise infrastructure had migrated to cloud by Q1 2025, one asks by what month the 70% migration milestone was complete, one asks which tech company disclosed a nation-state attack in January 2024. The final web hop carries no private information by itself and can be answered from public pages. But because the path to it depends on private local facts, a query that carries forward MediConn, 70%, and January hands the adversary enough context to recover internal information.
The agent harness is adapted from DRBench: the model advances hop by hop using four tools, Plan (produce local and web queries), Choose (select which retrieved documents to read), Read (answer the current hop in parallel from the selected documents), and Resolve (decide whether to answer, read more, or plan another search), giving a short answer plus justification per hop so each one can be scored individually with normalized string matching.
Why it matters
The first thing to take away: you cannot prompt privacy in. The obvious fix is to just ask, adding a line to the Plan prompt telling the agent not to issue web queries that leak local information. ServiceNow tried it. The verdict is that it helps slightly for some models, but the effect is inconsistent, substantial leakage remains, and it often drags task performance down with it. For Qwen3-4B the prompt lowered answer and full-information leakage from 34.0% to 25.5%, but strict chain success also fell from 48.7% to 44.5%. The deeper point is that the main behavioral change was the agent issuing fewer queries, not constructing safer ones. It got quieter, not smarter.
The second finding is the counterintuitive one and the tension at the heart of the paper: training the agent to be better at the task made it leak more. Before training for privacy they tried the obvious thing, rewarding it only to solve more chains correctly. It worked, with strict chain success rising from 48.7% to 59.3%. But answer and full-information leakage climbed right alongside it, from 34.0% to 51.7%. The model had learned to pack more context into its web queries, which helped it retrieve the right document and hurt privacy, because each richer query is another fragment handed to the observer. A more informative query is often better for the task and worse for privacy. The model did not get worse; the task objective and the privacy objective collide on the same action.
For any team deploying RAG (retrieval-augmented generation) plus a web-connected agent, that is a direct warning. Tuning your agent for recall, pushing it to write more specific and context-rich queries, may be training it into a more efficient leaker, and that side effect is invisible on a dashboard that tracks only task metrics.
Builder impact
If you are about to ship an agent that both reaches the open web and reads private documents, the judgment to carry away is this: agent data exfiltration is an engineering and training-objective problem, not an alignment slogan you patch with a do-not-leak prompt.
In deployment, the first move is to treat the outbound query log as a real leakage channel in your threat modeling, not as a debugging byproduct. In the MosaicLeaks threat model the adversary wants neither your documents nor your model weights, just that string of logs. Anyone who can see the agent’s outbound traffic is a potential reassembler: an upstream gateway, a third-party search API, a network tap. For healthcare and finance, where data exfiltration hits compliance lines directly, outbound traffic auditing should not look only for whole blocks of private text leaving the building. It has to ask whether a private fact can be reconstructed across many queries, which no single-rule match will catch.
The second move is the positive answer PA-DR gives: privacy has to be trained in, not filtered out. Its two rewards are worth borrowing. The first is a situational task reward. A single research trajectory can run to dozens of model calls, so giving them all the same final score is very weak credit, since a successful run reinforces a leaky search inside it and a failed run punishes a locally sound decision inside it. PA-DR instead judges each call against other calls made at the same stage and hop with the same information available, so credit lands on the specific action. The second is a learned privacy reward: whenever the agent produces web queries, a Qwen3-4B classifier estimates two risks, whether the current queries leak directly and whether adding them to the existing log creates a new mosaic leak, then penalizes the larger of the two, so the privacy cost lands on the exact planning decision that made the log more revealing.
The result holds both ends: strict chain success rises from 48.7% to 58.7% and answer and full-information leakage falls from 34.0% to 9.9%. That 9.9% is lower than the untrained base model’s own 34.0%, which means privacy training did not merely cancel the leakage that task training introduced. It left the agent leaking less than at the start. And it did not get there by searching less. PA-DR actually issues more web queries than the base model, but those queries drop the revealing details, specific metrics like 15% or 2024 and clues about the kind of answer it is hunting for. It still finds the right public documents. It just stops carrying private fragments along in the query text.
The situational reward pays off a second time on cost. Because it compares matching calls instead of scoring a whole rollout once, credit is assigned far more precisely, with no separate value model and no need to align step indices across rollouts. It is also markedly more sample-efficient: the situational task reward reaches outcome-only RL’s task performance with roughly 5 to 6 times fewer generated training samples, and PA-DR keeps that efficiency while adding the privacy gain. For teams training their own agents, that means writing privacy into the objective need not cost a mountain of compute.
What to ignore
The first misreading to kill: do not read this as research agents are now unusable, or as just another scary benchmark. The point lands the opposite way. It takes a risk that used to be a hand-waved worry and turns it into an engineering problem that is both measurable and has a working mitigation. The authors’ own summary is that you cannot prompt privacy in, you have to train it in. Telling an agent to be careful barely moves the needle, while rewarding how it constructs each query cuts leakage by more than 3x with task success essentially intact. This is a solution, not a death sentence for agents.
The second limit is one to label honestly, and the paper has a section for it: MosaicLeaks is a controlled benchmark, not a measurement of leakage in deployed systems. The enterprise documents are synthetic, the web corpus is fixed, the chains span three company contexts, and every result comes from a single agent harness running multi-hop question answering rather than open-ended research. That control is exactly what makes leakage measurable hop by hop. But neither 34.0% nor 9.9% can be extrapolated as your production agent’s leakage rate. Broader tasks, real deployments, and other agent designs each need their own study. Reading these numbers as a health check of your live system is a misuse. Reading them as an existence proof that this is measurable, trainable, and worth instrumenting on your own system is the right read.
FAQ
How does a web-connected agent actually leak private enterprise data?
Not by spilling the secret in one query, but by issuing several ordinary queries that an observer can reassemble into the secret. This is the mosaic effect. In MosaicLeaks the example is a healthcare firm, MediConn: one query references a cloud-migration milestone, one a security disclosure, one narrows down the vendor. No single query gives away the secret, but anyone watching the outbound traffic can recover the fact that MediConn had migrated 70% of its infrastructure to the cloud by January 2025, which lived only in private documents. The threat model is the key: the adversary never sees the private documents or the agent's reasoning, only the cumulative query log.
Can I just write a do-not-leak-private-information line in the prompt?
It barely works. ServiceNow added a line to the Plan prompt telling the agent not to issue web queries that leak local information. The effect was inconsistent and substantial leakage remained. For Qwen3-4B it lowered answer and full-information leakage from 34.0% to 25.5%, but strict chain success also dropped from 48.7% to 44.5%. The main behavioral change was the agent issuing fewer queries, not constructing safer ones. Privacy is a property of how each query is built, and a reminder does not change that.
Does training the agent to perform better make it leak more?
Yes, and that is the most counterintuitive finding. Reinforcement learning that rewards only solving more chains correctly does work, raising strict chain success from 48.7% to 59.3%, but answer and full-information leakage climbs right alongside it, from 34.0% to 51.7%. The model learns to pack more context into its web queries, which helps it retrieve the right document but hurts privacy, because each richer query hands the observer another fragment. A more informative query is often better for the task and worse for privacy, which is the central tension MosaicLeaks exposes.
How should I defend against leakage when deploying deep-research agents, and what does PA-DR do?
PA-DR (Privacy-Aware Deep Research) puts privacy into the training objective rather than filtering after the fact. It uses two rewards: a situational task reward that judges each model call against other calls made at the same stage and hop with the same information available, so credit lands precisely; and a learned privacy reward, where a Qwen3-4B classifier estimates whether the current queries leak directly and whether adding them to the existing log creates a new mosaic leak, penalizing the larger of the two. The result is strict chain success rising from 48.7% to 58.7% and answer/full-information leakage falling from 34.0% to 9.9%. It does not get there by searching less; PA-DR issues more queries than the baseline, just with the revealing details stripped out.
Sources
No official primary source available; this analysis is based on reliable secondary reporting (named outlets, cross-confirmed).