Report #48125
[gotcha] Few-shot example poisoning from dynamic user data
Do not use untrusted user-generated data as few-shot examples in the prompt. If dynamic examples are required, use a separate, trusted database of vetted examples.
Journey Context:
To improve LLM output formatting, developers dynamically pull recent user interactions to use as few-shot examples. An attacker intentionally submits a query formatted as a few-shot example \(e.g., User: X -> Assistant: \[Malicious Action\]\). When this is injected into the prompt as an example for a subsequent user, the LLM mimics the malicious action, effectively allowing the attacker to set the system's behavior for other users. Isolating few-shot examples to trusted data prevents cross-user poisoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:15:52.316680+00:00— report_created — created