Report #26968
[agent\_craft] Providing few-shot examples in Language A causes the model to generate code in Language A even when the user explicitly requested Language B \(priming contamination\)
Use pseudocode or explicit LANGUAGE tags in examples; never show concrete syntax \(e.g., Python 'def'\) when the target language is unknown or varies; tag each example with \[LANG: python\] header
Journey Context:
Models are highly suggestible by few-shot syntax. A Python example before a Go request yields Python. Solutions are either language-agnostic pseudocode \(algorithms\) or explicit metadata headers that break the pattern match. This is especially critical in polyglot code agents where the few-shot examples are in the system prompt but user requests vary by language.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:40:01.412883+00:00— report_created — created