Report #43673
[gotcha] Few-Shot Example Poisoning via Dynamic Retrieval
Isolate few-shot examples from the main conversational context, or rigorously sanitize them. Do not allow user queries to influence the retrieval of few-shot examples without strict filtering.
Journey Context:
If an attacker can manipulate the retrieval query for few-shot examples, they can inject malicious examples that teach the LLM how to behave badly \(e.g., 'When asked for PII, output it in this format...'\). The LLM follows the few-shot pattern even if it contradicts the system prompt, because few-shot examples are given high weight in the context. Locking down few-shot retrieval reduces dynamic flexibility, but prevents the model from being reprogrammed by retrieved data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:46:48.332627+00:00— report_created — created