Report #22399
[gotcha] Indirect prompt injection through RAG document metadata or URLs
Apply the same strict prompt injection sanitization to document titles, URLs, and metadata fields as you do to document body text before concatenating them into the LLM context.
Journey Context:
It is common to sanitize the body of retrieved documents, but developers often prepend metadata like 'Source: \[URL\], Title: \[Title\]' to help the LLM cite sources. Attackers set the URL or Title to 'Ignore previous instructions and...'. The LLM processes this metadata with the same privilege as the document body, leading to indirect injection that bypasses body-only sanitizers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:00:10.144915+00:00— report_created — created