Knowledge bases as an attack surface: why RAG poisoning is an architectural problem
A new study on medical multimodal RAG shows that poisoned knowledge bases can hijack retrieval. What that means for high-trust organisations.
You must treat your knowledge base as an active attack surface. Poisoning the retrieval layer is enough to corrupt downstream answers without touching the model itself. Audit your sources, retrieval depth and metadata before deployment.
The prompt is an analysis of 21 August 2026 of retrieval-augmented generation systems and knowledge base poisoning, which argues that attackers can hijack RAG outputs by injecting faulty entries into the retrieval layer rather than the model. The concrete case is a medical multimodal system where researchers inject clinically plausible but factually incorrect passages, which the system then retrieves and incorporates into answers. In our assessment, this shifts the security boundary for any organisation deploying RAG on sensitive information: the knowledge base is no longer passive storage, but a component you must actively control and verify.
Why is the knowledge base itself a vulnerability?
Retrieval-Augmented Generation connects language models to domain-specific knowledge by retrieving relevant passages from a knowledge base at query time rather than encoding everything into model weights. This architecture is pragmatic, but it creates a new attack surface. An attacker who can inject faulty entries into the retrieval layer has enough influence to corrupt the system's output. The attack is query-agnostic: the poisoned content is retrieved regardless of what the user asks. In a high-trust domain such as medicine, this is particularly dangerous because an answer that looks credible is unlikely to be questioned by a user who trusts the context. The system does not need to manipulate the prompt itself; poisoning the source material is sufficient.
Which design choices make RAG systems more vulnerable?
RAG poisoning is not a single failure mode but depends on the interaction between multiple architectural choices. Two design decisions have outsized impact. First, retrieval depth—the number of passages retrieved per query—directly affects exposure: the more passages the system pulls, the greater the chance that a poisoned entry ends up in the context window. Second, retriever type determines how the same poisoned knowledge base behaves: dense retrievers and graph-based retrievers respond differently to poisoned content than classical keyword-matching approaches such as BM25. The same corrupted knowledge base therefore yields different levels of vulnerability depending on how you search it. This makes RAG poisoning primarily an architectural question, not a problem you solve afterwards with a single filter.
What attack methods evade simple defences?
Manipulation need not be visible to the naked eye. Attackers can poison metadata fields—the descriptive text associated with images or documents—while leaving the visual content untouched. The image appears correct, but the associated metadata steers retrieval in the wrong direction. Defences that look only at visible content or rely on simple filters fall short. A knowledge base that passes inspection may nevertheless be compromised via seemingly innocuous metadata fields. Stealthy poisoning remains possible even when basic safeguards are applied, which means you cannot rely on surface-level verification alone.
What controls must you demonstrate?
Defensive research shows that effective protection requires a layered approach applied at the retrieval layer itself, not downstream. The failure modes and risk categories you must address are:
- Query-agnostic poisoning — attackers inject faulty entries that are retrieved regardless of user input.
- Metadata manipulation — sensitive fields are corrupted while visible content remains intact.
- Retrieval depth exposure — systems that pull more passages per query have higher risk of incorporating poisoned content.
- Retriever type variance — different search algorithms expose the same poisoned knowledge base to different degrees.
- Stealthy corruption — poisoning can remain undetected by simple filters or surface-level inspection.
To control this risk, you must be able to demonstrate:
- Audit knowledge base provenance before deployment — document the source, date and verification status of every entry in your retrieval corpus.
- Define and justify retrieval depth — set the number of passages retrieved per query based on your tolerance for poisoned content reaching the context window.
- Inspect and verify metadata fields — treat descriptive text, tags and associated data with the same scrutiny as primary content.
- Harden the retrieval layer — apply filtering and verification at the point where documents are selected, not after generation.
- Establish a fail-closed verification workflow — ensure that if a source cannot be verified, the system does not proceed rather than defaulting to retrieval.
What role does tooling play?
Technology can support control of the data chain, but it cannot replace professional judgement. Verification layers can expose which sources underpin an answer and highlight disagreements between independent models, making the retrieval step visible for inspection. Privacy-focused approaches can replace sensitive document values with synthetic equivalents before processing, restoring originals only after verification succeeds. These tools make the attack surface more transparent and auditable, but the final decision on whether to trust an answer remains yours. No filter certifies that content is correct; tooling can only make the sources and reasoning steps available for your review.
Written by
Tobias Lindqvist
Adversarial machine learning and the security properties of retrieval systems.