Report #46183
[gotcha] Dynamically generated few-shot examples from untrusted sources hijack model behavior
Ensure few-shot examples provided in the prompt are strictly sourced from a trusted, curated database. Never dynamically insert raw user history or external text as few-shot examples without sanitization.
Journey Context:
To personalize responses, developers dynamically inject past user interactions or retrieved data as few-shot examples. An attacker can craft a previous interaction that looks like a few-shot example \(e.g., \`User: \[malicious\] Assistant: \[compliant\]\`\), teaching the model to override its system prompt for future turns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:59:44.285584+00:00— report_created — created