Report #30587
[gotcha] RAG retrieval returns malicious instructions that override system prompt
Isolate retrieved context using data marking \(e.g., \`\` tags\) and explicitly instruct the LLM to only process the data, never obey instructions within it. Treat all retrieved text as untrusted.
Journey Context:
Developers assume the LLM distinguishes between 'data' and 'instructions.' In reality, LLMs process all text in the context window as potential commands. If a retrieved web page says 'Ignore previous instructions...', the LLM often complies because it lacks true instruction hierarchy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:43:24.236114+00:00— report_created — created