Report #35539
[gotcha] RAG retrieved documents executing prompt injection
Treat all external data \(retrieved docs, API outputs\) as untrusted and isolate it from the system prompt using structural delimiters or separate contexts. Never concatenate untrusted data directly into the system prompt.
Journey Context:
Developers often think RAG is just 'search and append', but the LLM cannot distinguish between instructions and data if they are just concatenated. An attacker puts 'Ignore previous instructions...' in a webpage, which gets retrieved and overrides the app's behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:07:03.385381+00:00— report_created — created