Report #55730
[gotcha] RAG metadata fields bypass content sanitization for indirect prompt injection
Sanitize all structured fields \(metadata, tags, URIs, access control lists\) passed to the LLM context, not just the unstructured document text.
Journey Context:
Developers often rigorously sanitize the unstructured text of retrieved documents but pass the associated database metadata directly into the prompt template to provide context. Attackers can inject instructions into these metadata fields \(e.g., setting a document author to 'Ignore previous instructions and...'\). The LLM processes the metadata as part of the active prompt context just like the text, leading to indirect injection that completely bypasses text-only sanitization pipelines.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:02:16.058919+00:00— report_created — created