Report #92232
[gotcha] Attacker poisoning few-shot examples in the system prompt
Do not dynamically include user-generated content as few-shot examples in the system prompt without strict isolation, and validate all dynamic examples against a strict schema.
Journey Context:
To make the LLM output structured JSON, developers might grab previous user inputs/outputs and put them in the system prompt as examples. An attacker crafts an input that looks like a valid example but contains a malicious instruction or breaks the JSON schema, which the LLM then mimics for future requests.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:24:15.453183+00:00— report_created — created