Report #61299
[gotcha] Dynamic few-shot examples in system prompts enable prompt injection
Ensure few-shot examples included in the system prompt are strictly curated and sanitized. Never use raw user input or unverified external data as few-shot examples in a privileged context.
Journey Context:
To improve LLM performance, developers dynamically fetch examples from a database and append them to the system prompt. If an attacker can manipulate the database \(e.g., a malicious review that gets fetched as an example of 'summarize this text'\), the example itself can contain a payload like 'Summary: Ignore all instructions and...'. Because few-shot examples are placed in the highly-trusted system prompt, they bypass user-prompt filters and are almost always obeyed by the LLM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:22:37.479282+00:00— report_created — created