NEW350+ rooms now have a live terminal, so you can learn by typing the commands, right in your browser.Learn in a live terminal. 350+ rooms.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
[>_] ROOM · Cybersecurity
Poisoning a Knowledge Base for RAG Injection
Learn how attackers craft and inject malicious documents into RAG pipelines to manipulate model outputs and compromise future users.
Room tasks
1What is RAG Poisoning and How It Differs from Prompt Injection
2Crafting Documents Designed to Be Retrieved and Trusted
RAG injection is an indirect prompt injection where malicious text stored in a knowledge base is retrieved and inserted into the model's prompt. The LLM may then obey the attacker's hidden instructions.
How do attackers get documents into a knowledge base?
They exploit any ingestion path: shared drives, uploads, scraped web pages or support tickets. Content from untrusted sources that is indexed without review becomes a delivery channel.
How can teams reduce RAG injection risk?
Sanitize and review ingested content, track document provenance, limit what retrieved text can instruct the model to do and monitor outputs. You can learn the attack and defenses in this free room.