You ask an AI chatbot for a simple PowerShell script to manage your Windows files. It gives you a script. You run it, and it throws an error. You ask it to fix the error, and it gives you a made-up command that doesn’t even exist in Windows.
This is called an AI “hallucination.” Language models are essentially advanced predictive text engines; they want to give you an answer so badly that they will confidently lie to you rather than say “I don’t know.” Here is how I train the AI to stop lying when I use it for tech support.
1. The “Admit Ignorance” Prompt
You have to explicitly give the AI permission to fail. If you don’t, its core programming forces it to guess.
Always add this sentence to the end of a complex prompt:
“If you do not know the exact answer, or if you are only 90% sure, say ‘I DO NOT KNOW’. Do not guess. Do not make up commands.”

2. Lower the “Temperature”
If you are using an AI via an API or a developer playground (like the OpenAI Playground or Anthropic Console), you have access to a slider called Temperature.
- Temperature controls creativity. A high temperature (0.8 to 1.0) makes the AI write great poetry, but terrible code.
- If you need facts, coding help, or troubleshooting steps, turn the Temperature down to 0.1 or 0.0. This forces the AI to be highly deterministic and boring, drastically reducing hallucinations.

3. Demand Step-by-Step Logic (Chain of Thought)
AI models hallucinate most often when you ask them for a massive, complex answer all at once. You can force the AI to catch its own mistakes by making it explain its logic first.
Instead of: “Write a script to backup my registry.”
Use: “I need a script to backup my registry. Before writing the code, think step-by-step about what Windows commands are required to do this safely. Write out your logic. Once you have validated the logic, write the script.”
4. Provide the Documentation (RAG)
If you ask an AI about a software update that was released yesterday, it will hallucinate because its training data is months old.
Instead of asking it to guess, copy and paste the official documentation page into the chat box, and type: “Using ONLY the text I have provided above, answer my question.”
FAQ
Why do AI models lie so confidently?
They aren’t actually “lying” because they don’t know what the truth is. They are statistical models predicting the next most likely word in a sentence based on their training data. If a fake command sounds statistically similar to real tech jargon, the AI prints it without hesitation.
Faizan Ahmed is a senior IT specialist and the lead editor at TechWiredWorld. With over a decade of experience repairing PCs and mobile devices, his mission is to provide clear, actionable tech troubleshooting guides.