Report #49749
[gotcha] Dynamic few-shot examples poisoning LLM behavior
Do not use untrusted user-generated data as few-shot examples. If dynamic examples are necessary, strictly validate their format and content, or use a separate, isolated LLM call to generate/sanitize the examples before injecting them into the main prompt.
Journey Context:
Developers use vector search to find 'similar past queries' to populate few-shot examples, assuming it just improves accuracy. An attacker submits a query that gets retrieved as a few-shot example for future users, effectively turning the few-shot context into a persistent, indirect prompt injection vector.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:59:19.787566+00:00— report_created — created