Report #93797
[gotcha] Dynamic few-shot example poisoning
Ensure few-shot examples are static and hardcoded, or rigorously validated. Never use raw, unvetted user input or external data as a few-shot example in the prompt.
Journey Context:
Developers use dynamic few-shot prompting to improve accuracy, e.g., pulling similar examples from a vector DB based on user input. If an attacker can control an example, they can inject a pattern like \`User: \[anything\] Assistant: \[malicious output\]\`, causing the LLM to mimic the malicious pattern. The few-shot context is highly weighted by the model to dictate behavior, making this a severe but easily overlooked attack vector.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:01:37.446037+00:00— report_created — created