Agents

Single poisoned document flips RAG system answers

Reviewing ToxicRAG: Compromising Retrieval-Augmented Generation Systems via Single-Shot Knowledge Poisoning Attacks · Haozhe Lu, Jiaqi Li, Xinyuan Zhu et al.

Single poisoned document flips RAG system answers

New research shows a single crafted document can push Retrieval-Augmented Generation (RAG) systems to output attacker-chosen false answers. The “ToxicRAG” method packages misinformation as a believable update narrative and reaches 0.61–0.91 attack success rates across datasets, models and retrievers. It underlines how source manipulation, not prompts, can steer Large Language Models.

Retrieval-Augmented Generation (RAG) promises grounded answers by letting a Large Language Model (LLM) read from a document store at query time. That retrieval step also opens a quiet side door. ToxicRAG shows you can slip in a single poisoned document per target question and get the system to state your preferred, wrong answer with striking reliability.

The trick is narrative, not noise. The injected document reads like a knowledge update: it acknowledges the old, widely accepted answer, invents plausible events that would overturn it, then cites named-sounding authorities as if a consensus has shifted. That structure plays to how LLMs weigh context and authority cues. The attacker does not need access to the model or retriever internals, only the ability to append one document per target to the index.

The authors add a self-validation loop. They generate a candidate poisoned document, query a surrogate LLM, and check whether the model now reproduces the attacker’s target answer. If it does not, they revise and try again for a fixed number of attempts. No probing of the eventual victim system is required.

In sampled-corpus tests on 100 questions each from Natural Questions, HotpotQA and MS-MARCO, across four 4B–8B LLM endpoints and four dense retrievers, ToxicRAG’s end-to-end attack success rate (ASR) ranges from 0.61 to 0.91, depending on the dataset–model pairing. By dataset: 0.86–0.91 on Natural Questions, 0.74–0.80 on HotpotQA, and 0.61–0.63 on MS-MARCO. It matches or beats the strongest baseline in all tested combinations, with margins up to 11 percentage points.

One finding will interest anyone tuning retrieval: more frequent or higher-ranked poison retrieval did not always mean higher ASR. Some baselines surfaced the poison more often, yet ToxicRAG still won on final answers. The generation-side content matters. A coherent “paradigm shift” story can outweigh simple keyword hits once the text is in-context.

Sensitivity checks show trends with corpus size, top-k, retriever choice, requested document length, number of cited authorities, and refinement attempts, but these are empirical points, not causal claims. Limitations are clear: sampled corpora, small LLMs, dense retrieval only, single-run estimates, and any-poison retrieval metrics that are not target-specific. Automatic judging aligns well with human labelling, though shared model errors remain possible.

For agent builders who wire RAG into planning and tool use, the takeaway is stark: corpus write access is an attack surface. One credibly written “update” can redirect answers, and by extension, downstream actions. The policy question is not abstract here. Provenance, corroboration and corpus governance are going to decide whether knowledge-grounded agents can be trusted at all. That is hard to standardise, but the alternative is building systems that believe the last document they read.

Further analysis

Problem

The paper studies single-shot knowledge poisoning of Retrieval-Augmented Generation (RAG) systems: whether a single injected document per target can cause a RAG pipeline to produce a specific incorrect answer. This matters because RAG systems ground LLM outputs in retrieved external documents, creating an attack surface where an adversary who can append documents to the retrieval corpus may influence inference without retraining the generator. The work probes how a poisoned document must be both retrievable and generation‑influential while remaining natural enough to blend with normal corpus content.

Approach

ToxicRAG constructs one poisoned document per target that presents a coherent "Evolutionary Paradigm‑Shift Narrative": it states the previously accepted answer, invents fabricated causal events that purportedly invalidate that answer, and attributes the attacker‑selected target answer to multiple purported authorities. An answer‑focused self‑validation loop uses a surrogate language model to check whether the candidate document elicits the target answer; failing candidates are revised up to a configured number of times. The attacker is black box with respect to victim generator and retriever parameters and only needs the ability to append one document per target to the indexed corpus. Evaluation used 100 sampled target questions from each of Natural Questions, HotpotQA and MS‑MARCO, four victim LLM endpoints (4B–8B class), four dense retrievers, and a sampled-corpus FAISS index with k=5 retrieved passages by default. Metrics include end‑to‑end attack success rate (ASR) and several any‑poison retrieval statistics that count whether any injected document appears in the top‑k results.

Key Findings

  • ToxicRAG achieves high end‑to‑end ASRs in the sampled‑corpus experiments: overall ASRs ranged between 0.61 and 0.91 across the twelve dataset–model combinations.
  • Per dataset, reported ToxicRAG ASRs were 0.86–0.91 on Natural Questions, 0.74–0.80 on HotpotQA, and 0.61–0.63 on MS‑MARCO. ToxicRAG matched or outperformed the strongest evaluated baseline in eleven of twelve cells and tied once, with margins from 0 to 11 percentage points.
  • Higher retrieval concentration of poisoned documents (for example higher Top‑1 or dominance measures) did not always predict higher ASR: some baselines scored higher on retrieval metrics while ToxicRAG produced higher end‑to‑end ASR, indicating the generation‑side content and narrative form matter for success.
  • Sensitivity tests showed ASR varies with corpus size, retrieval set size k, retriever choice, requested document length, number of virtual authorities, and number of refinement attempts, but these effects were reported as empirical single‑run trends rather than causal explanations.

Limitations

Experiments are sampled‑corpus runs using 100 queries per dataset rather than full million‑document indices, and retrieval metrics reported are any‑poison counts that are not target‑specific. The attacker model uses a generation‑only surrogate for validation and does not query the victim system during construction. Results are single‑run point estimates without confidence intervals, evaluated on four 4B–8B victim endpoints and dense retrieval only. Automatic judging was validated against human annotation (Cohen’s kappa ≈0.90 for NQ, 0.81 for HotpotQA, 0.92 for MS‑MARCO) but evaluation noise and shared model errors remain possible.

Implications

An attacker with write access to a retrieval corpus and the ability to append one document per target can craft a plausible update narrative that persuades RAG systems to produce attacker‑selected false answers. The attack demonstrates that manipulation of retrieved sources, rather than prompt manipulation or model fine‑tuning alone, is sufficient to induce targeted misinformation at inference time across multiple models and retrievers. Offensive consequences include targeted misinformation delivery, corruption of knowledge bases relied upon by downstream tools, and undermining trust in systems that naively accept retrieved text as authoritative. The findings highlight the importance of provenance and cross‑source corroboration as attack surfaces for adversaries seeking to subvert knowledge‑grounded AI.

The paper title, authors and abstract

ToxicRAG: Compromising Retrieval-Augmented Generation Systems via Single-Shot Knowledge Poisoning Attacks

Haozhe Lu, Jiaqi Li, Xinyuan Zhu, Xiang Li

Retrieval-Augmented Generation (RAG) can ground large language model (LLM) outputs in external evidence, but it also exposes the system to knowledge poisoning. Representative attacks use multiple injected documents or templates that directly assert a target answer. We present ToxicRAG, a one-document-per-target attack that expresses misinformation as a coherent knowledge-update narrative. The generated document first acknowledges the previously accepted answer, introduces fabricated events that appear to invalidate it, and then attributes the attacker-selected answer to a set of purported authorities. An answer-focused self-validation loop optionally revises a candidate when a surrogate language model does not reproduce the target answer. We evaluate the attack on 100 target questions from each of Natural Questions, HotpotQA, and MS-MARCO, using four victim LLMs and four dense retrievers. In the sampled-corpus setting reported in this paper, ToxicRAG obtains ASRs between 0.61 and 0.91 across the twelve dataset--model combinations. It matches or exceeds the strongest evaluated baseline in every combination, with margins ranging from 0 to 11 percentage points. These results show that narrative-form poisoned documents can remain influential under the evaluated RAG configurations and motivate further study of factual consistency and source provenance in RAG systems.