Negative Prompting
Tell AI what NOT to do for cleaner, more focused results by defining explicit exclusion rules.
The Problem
AI models try to be helpful by default, which means they add disclaimers, suggest alternatives you did not ask for, explain things you already know, and pad responses with unnecessary context. Positive instructions alone (“be concise”) are vague. Negative instructions (“do not add disclaimers”) create clear boundaries that the model follows much more reliably.
The Prompt
[Your main task instruction]
DO NOT:
- Add disclaimers or safety caveats
- Suggest alternatives unless explicitly asked
- Explain basic concepts I already know
- Use filler phrases like "Great question!" or "Sure, I can help with that"
- Repeat the question back to me
- Add a summary section at the end
- Use emojis or bullet-point headers with emojis
- Wrap the entire response in a code block unless the output IS code
ASSUME:
- I am a [experience level] developer
- I understand [technologies/concepts you know]
- I want the direct answer, not a tutorial
Example Output
The memory leak is in your useEffect cleanup. When the component unmounts, the WebSocket
connection stays open because you return nothing from the effect.
Fix:
useEffect(() => {
const ws = new WebSocket(url);
ws.onmessage = handleMessage;
return () => ws.close(); // Add cleanup
}, [url]);
The dependency array should include `url` only — adding `handleMessage` will cause
reconnections on every render unless you memoize it with useCallback.
When to Use
Use negative prompting when you keep getting the same unwanted patterns in AI responses — excessive explanations, unsolicited alternatives, boilerplate disclaimers, or formatting that does not match your needs. It pairs perfectly with constraint engineering for maximum control over output quality.
Pro Tips
- Collect your “do not” list iteratively — each time the model adds something unwanted, add it to your negative prompt for next time.
- Be specific, not general — “do not add disclaimers” works better than “be direct” because it targets a concrete behavior.
- Combine positive and negative — “Write only the SQL query (do not add explanations, do not use comments)” is stronger than either instruction alone.
- Save your negative prompt as a template — once you have a reliable “do not” list, reuse it across sessions for consistent output quality.