Report #69014
[gotcha] Dynamically generated few-shot examples containing malicious instructions
Never use user-generated content or untrusted external data to construct few-shot examples. If few-shot examples are dynamically retrieved, ensure they are strictly classified or generated by a trusted, isolated LLM.
Journey Context:
To improve LLM performance, developers often build dynamic few-shot prompts by retrieving 'similar past interactions' from a vector database. If a user intentionally crafts an input that matches a query, and their past interaction \(now stored in the DB\) contains a successful prompt injection, that injection becomes part of the few-shot examples in the system prompt. The LLM will eagerly follow the few-shot pattern, making this a highly effective and persistent attack vector.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:19:26.379575+00:00— report_created — created