MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attacks

Tailun Chen, Yu He, Yan Wang, Shuo Shao, Haolun Zheng, Zhihao Liu, Jinfeng Li, Yuefeng Chen, Zhixuan Chu, Zhan Qin

Abstract

Retrieval-Augmented Generation (RAG) systems enhance Large Language Models (LLMs) with external knowledge but introduce a critical attack surface: corpus poisoning. While recent studies have demonstrated the potential of such attacks, they typically rely on impractical assumptions, such as white-box access or known user queries, thereby underestimating the difficulty of real-world exploitation. In this paper, we bridge this gap by proposing MIRAGE, a novel multi-stage poisoning pipeline designed for strict black-box and query-agnostic environments. Operating on surrogate model feedback, MIRAGE functions as an automated optimization framework that integrates three key mechanisms: it utilizes persona-driven query synthesis to approximate latent user search distributions, employs semantic anchoring to imperceptibly embed these intents for high retrieval visibility, and leverages an adversarial variant of Test-Time Preference Optimization (TPO) to maximize persuasion. To rigorously evaluate this threat, we construct a new benchmark derived from three long-form, domain-specific datasets. Extensive experiments demonstrate that MIRAGE significantly outperforms existing baselines in both attack efficacy and stealthiness, exhibiting remarkable transferability across diverse retriever-LLM configurations and highlighting the urgent need for robust defense strategies.

The Vulnerability of RAG Systems

Retrieval-Augmented Generation (RAG) has become the gold standard for grounding LLMs in factual, up-to-date information. However, this reliance on external knowledge bases creates a massive "corpus poisoning" attack surface. Current security research often relies on "impractical assumptions," such as having white-box access to the system's gradients or knowing exactly what a user will ask (query-specific attacks).

Comparison of MIRAGE with existing poisoning methods, highlighting its ability to operate without gradients, API access, or query-specific knowledge.

The paper introduces MIRAGE, a framework designed to operate in a strict black-box and query-agnostic setting—the most realistic and dangerous threat model for production systems. Unlike previous methods, MIRAGE does not require internal model access or prior knowledge of user queries, making it uniquely dangerous to deployed systems.

The MIRAGE Framework

MIRAGE bridges the gap between academic theory and real-world exploitation through a three-phase pipeline:

The three-phase MIRAGE pipeline: Query Distribution Modeling, Semantic Anchoring, and Adversarial Alignment via Test-Time Preference Optimization.

1. Query Distribution Modeling

To attack a system without knowing the user's query, MIRAGE approximates the "latent search distribution." It uses Ellis’s Behavioural Model of Information Seeking to generate six distinct user personas (e.g., Novice, Explorer, Expert). A public LLM then generates a cluster of diverse queries these personas might use to find a specific fact, ensuring the attack covers a wide range of potential user intents.

2. Semantic Anchoring

Instead of "keyword stuffing" or appending gibberish, MIRAGE strategically weaves the synthesized queries into the natural prose of the document. This "anchors" the document in the retriever's vector space near the target queries while maintaining linguistic coherence and stealth.

3. Adversarial Alignment (TPO)

Using Test-Time Preference Optimization (TPO), MIRAGE employs a "Critic-Editor" loop. A surrogate retriever and LLM provide feedback (rewards) on how likely the document is to be retrieved and how persuasive it is. An "Optimizer LLM" then generates a Textual Gradient—natural language instructions on how to rewrite the document to be more misleading—and an "Editor LLM" implements those changes.

Experimental Evaluation

The authors constructed a rigorous benchmark using three long-form, domain-specific datasets: BioASQ (biomedical), FinQA (financial), and TiEBe (events). These datasets feature significantly longer documents (averaging 1,500 to 8,000+ characters), providing a more realistic "needle-in-a-haystack" challenge for the attacker.

Key Results

  • Dominant Efficacy: In fact-level attacks on the BioASQ dataset, MIRAGE achieved an Attack Success Rate (ASR) of ~78%, significantly outperforming baselines like PoisonedRAG-B (~56%) and GCG, which failed in this black-box setting.
  • Resilience to Defense: MIRAGE proved highly resilient to common defenses. When the number of retrieved documents ($k$) was increased to 20 to "dilute" the poison, MIRAGE maintained a success rate of 62.78%, while other methods dropped significantly.
  • Transferability: Attacks optimized on one set of surrogate models (e.g., a Qwen retriever and a Llama generator) successfully transferred to different target models (e.g., BGE retrievers and GPT-4o).
  • Stealth: Qualitative case studies revealed that advanced reasoning models often prioritize MIRAGE-poisoned documents because they appear more granular or "authoritative" (e.g., citing a fake press release) over reputable sources.

Conclusion

MIRAGE highlights a critical gap in RAG security. Current defenses like paraphrasing or perplexity filtering are largely ineffective against semantically coherent poisoning. This research signals an urgent need for new defense strategies, such as fine-grained stylometry or automated factual consistency checking, to protect the integrity of retrieval-augmented systems.

Summary updated

Abstract

Retrieval-Augmented Generation (RAG) systems enhance LLMs with external knowledge but introduce a critical attack surface: corpus poisoning. While recent studies have demonstrated the potential of such attacks, they typically rely on impractical assumptions, such as white-box access or known user queries, thereby underestimating the difficulty of real-world exploitation. In this paper, we bridge this gap by proposing MIRAGE, a novel multi-stage poisoning pipeline designed for strict black-box and query-agnostic environments. Operating on surrogate model feedback, MIRAGE functions as an automated optimization framework that integrates three key mechanisms: it utilizes persona-driven query synthesis to approximate latent user search distributions, employs semantic anchoring to imperceptibly embed these intents for high retrieval visibility, and leverages an adversarial variant of Test-Time Preference Optimization (TPO) to maximize persuasion. To rigorously evaluate this threat, we construct a new benchmark derived from three long-form, domain-specific datasets. Extensive experiments demonstrate that MIRAGE significantly outperforms existing baselines in both attack efficacy and stealthiness, exhibiting remarkable transferability across diverse retriever-LLM configurations and highlighting the urgent need for robust defense strategies.
BibTeX
@misc{chen2025mirage,
  author = {Tailun Chen and Yu He and Yan Wang and Shuo Shao and Haolun Zheng and Zhihao Liu and Jinfeng Li and Yuefeng Chen and Zhixuan Chu and Zhan Qin},
  title = {{MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attacks}},
  year = {2025},
  eprint = {2512.08289},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.08289},
}
Figure