Report #87700
[gotcha] RAG metadata injection allows indirect prompt injection
Sanitize all RAG metadata \(filenames, URLs, timestamps, author fields\) as strictly as document text, or exclude metadata from the LLM context entirely.
Journey Context:
Developers often strip injection attempts from the retrieved text chunks but pass the source document metadata directly into the context to provide citations. The LLM reads this metadata and executes the payload. Treating metadata as safe text is a critical oversight because the model does not differentiate between a chunk of text and a metadata key-value pair.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:47:37.497455+00:00— report_created — created