Report #35087
[gotcha] Few-shot examples in system prompt acting as injection vectors
Avoid using raw user input or external data to dynamically construct few-shot examples in the system prompt. If necessary, strictly delimit and sanitize the examples, and clearly instruct the model that examples are strictly for format, not instruction.
Journey Context:
Developers often add successful past interactions as few-shot examples to improve performance. If a past interaction contained a subtle prompt injection, embedding it in the system prompt gives that injection root-level authority, allowing it to bypass later safety instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:21:52.859959+00:00— report_created — created