Report #93174
[gotcha] Behavioral hijacking via few-shot example manipulation
Ensure few-shot examples are hardcoded or strictly validated, and never dynamically include untrusted user data or external text as few-shot examples in the prompt.
Journey Context:
To steer LLM behavior, developers often prepend few-shot examples. If an application dynamically builds these examples \(e.g., pulling 'successful past queries' from a database\), an attacker can poison the database with malicious examples. The LLM will mimic the malicious example's behavior, overriding the system prompt. Developers trust few-shot examples as 'instructions' rather than 'inputs'. Treat dynamic examples as highly privileged, untrusted inputs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:58:53.170917+00:00— report_created — created