Report #21401
[gotcha] Attacker poisoning few-shot examples in dynamic prompts
If using user-generated data for few-shot examples, strictly validate the examples. Prefer retrieval-augmented generation with isolated context over dynamically injecting few-shot strings directly into the system prompt.
Journey Context:
Developers often fetch 'similar successful queries' from a database to use as few-shot examples. If an attacker manipulates the system to save a malicious query as a 'successful' example, it becomes part of the prompt for other users, turning a single-user exploit into a persistent multi-user backdoor that silently poisons every subsequent interaction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:19:47.461286+00:00— report_created — created