Report #46323
[gotcha] Few-Shot Poisoning via Dynamic Examples
Strictly separate few-shot examples from user input, and never dynamically include user-generated content as few-shot examples in the system prompt. Use a dedicated examples block if the API supports it, or prefix them clearly.
Journey Context:
To improve accuracy, developers sometimes dynamically add previous successful interactions or user-submitted formatting examples into the prompt. An attacker can submit a formatting example that contains a prompt injection payload. Because it's placed in the context as an example of how to behave, the LLM gives it high weight, effectively overriding the system instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:13:47.626224+00:00— report_created — created