Report #52962
[counterintuitive] Adding 'Do not write buggy code' or 'Do not hallucinate API methods' to the prompt
Provide positive constraints and grounding context \(e.g., 'Only use methods from the attached documentation', 'Write unit tests for edge cases X and Y'\).
Journey Context:
LLMs are next-token predictors; negative constraints often draw attention to the exact behavior you want to avoid, increasing its likelihood \(the 'pink elephant' problem\). Telling a model 'don't hallucinate' provides no actionable token-distribution shift. Providing a reference document and saying 'use only these APIs' gives it a concrete distribution to sample from, effectively preventing hallucination without naming it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:23:32.994412+00:00— report_created — created