Day 12 of 1460 minExploit ArchitectHands-on lab
Day 12: RAG Security Day 12 — Document Poisoning and Indirect Prompt Injection
Taught by Mr Elite Updated
By the end of today you can
- Explain how a document enters a RAG knowledge base and becomes eligible for retrieval
- Distinguish ordinary document content from indirect instructions embedded in retrieved text
- Describe how query wording and retrieval relevance affect document selection
- Run the designated exercises only in the supplied training environment
- Identify ingestion controls including sanitisation, length limits, provenance checks and review queues
A RAG application does not answer from the model alone. It may first search a knowledge base, select passages, and place those passages into the model's context. This creates an additional trust boundary: documents are data, but a model may interpret instruction-like text inside them as commands.
Document poisoning takes advantage of the knowledge-base path. If an untrusted or insufficiently reviewed document is accepted and later retrieved for a relevant query, it can influence the evidence shown to the model. Indirect prompt injection is the related risk in which retrieved content contains instructions that attempt to redirect the model's behaviour.
Today you will examine this chain in a controlled lab: ingestion, indexing, retrieval, context construction and answer generation. The goal is to understand the failure mode and its controls—not to target a real service or introduce unapproved content into a production knowledge base. Use only the supplied training environment and its synthetic documents.
In this lesson
- How document poisoning enters a RAG pipeline
- Indirect prompt injection in retrieved text
- Query targeting, trigger phrases and retrieval behaviour
Premium course
$27 one-time, lifetime access
This day is part of the full course. Unlock it to read every lesson, do every mission and track your progress to the end.
Privileged members get every paid course included. See the plans