Report #85715
[gotcha] Attackers create documents that semantically collide with benign queries to inject malicious instructions into the RAG context
Implement relevance thresholds \(e.g., minimum cosine distance\) for RAG retrieval, and do not inject documents that fall below the threshold just to fill the context window.
Journey Context:
Developers configure RAG to return the Top K documents. If K=5 and only 1 document is truly relevant, the vector database might return 4 irrelevant, low-score documents. If an attacker has poisoned the vector space with documents that have weak semantic similarity to popular queries, they can slip into the Top K and get injected into the context, executing an indirect prompt injection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:27:23.644842+00:00— report_created — created