How to Write Better AI Instructions
If you’re building AI agents for customer support, sales, or internal workflows, the quality of your instructions directly determines the quality of the output.
When instructions are vague, overly rigid, or too open-ended, AI tends to:
Hallucinate details
Over-explain
Invent edge cases
Miss required steps
Sound robotic or scripted
This guide walks you through how to write clear, tight, and production-ready AI instructions that reduce hallucination and improve consistency.
1. Start With Clear Objectives (Not Just Behavior)
Bad example:
Answer customer questions about pricing.
Better example:
Provide clear, concise answers about pricing. Do not generate exact pricing without required inputs. Escalate if pricing depends on unavailable data.
Why this works:
It defines scope.
It defines constraints.
It defines escalation conditions.
👉 Always define what the AI should NOT do, not just what it should do.
2. Separate Facts from Assumptions
AI hallucinates most often when it fills gaps.
To prevent this, explicitly define:
Known facts
Unknown variables
Escalation triggers
Example:
Instead of:
Explain specialty item exceptions.
Write:
Do not assume a product has special requirements unless explicitly stated. If unsure, escalate instead of guessing.
👉 If it’s not defined, the AI should not invent it.
3. Avoid Overly Rigid Scripted Responses
Many people write prompts like:
Respond with: “You can order just one item.”
This creates problems:
AI outputs exact phrasing every time
It fails to adapt to language or tone
It may ignore translation
It sounds robotic
Better approach:
Clearly confirm customers can order as few as one item. Use natural language adapted to the customer's tone.
This preserves intent without forcing exact wording.
👉 Define intent, not exact sentences.
4. Use Structured Flow Instead of Paragraph Instructions
Unstructured instructions increase inconsistency.
Instead of:
When customers ask about pricing, answer clearly and collect details before escalating.
Write:
Pricing Request Flow
Ask for quantity.
Ask for ZIP code.
Optionally ask for phone number.
Escalate to specialist.
This reduces interpretation variability and improves determinism.
👉 AI performs better with step-based logic.
5. Add Explicit “Do Not Guess” Rules
If you don’t explicitly ban guessing, AI will try to be helpful.
Add rules like:
Do not speculate.
Do not estimate pricing.
Do not invent product restrictions.
Escalate if unsure.
This dramatically lowers hallucination rates in production.
6. Limit Explanations to a Defined Scope
Over-explanation often leads to hallucination.
Example:
Instead of:
Explain why bulk pricing is cheaper.
Write:
Explain that setup and production time are shared across more items. State that bulk discounts are applied automatically. Do not expand beyond this explanation.
By bounding the explanation, you reduce creative drift.
7. Define Escalation Conditions Clearly
AI fails when escalation is vague.
Weak instruction:
Escalate if necessary.
Strong instruction:
Escalate immediately if:
Customer requests exact pricing.
Required data is missing.
Product rules are unclear.
You are unsure of the answer.
Clear triggers = fewer hallucinations.
8. Use Sequential Steps for Troubleshooting (One Step at a Time)
When guiding users through troubleshooting, always provide instructions in a clear, sequential format.
Do not overload the user with multiple steps at once.
Why This Matters
When AI provides too many instructions in one message:
Users feel overwhelmed
Important steps get skipped
Responses become unclear
The conversation becomes harder to track
Error rates increase
Sequential guidance improves completion rates and reduces confusion.
Best Practice
Provide one actionable step at a time
Wait for confirmation or result before moving to the next step
Keep each step short and specific
Avoid combining multiple troubleshooting actions in a single message
Bad Example
Please clear your cache, restart your browser, check your internet connection, verify your login credentials, and try again.
This creates friction and reduces clarity.
Good Example
Step 1:
Please refresh the page and let me know if the issue continues.
(Wait for user response.)
Step 2 (if needed):
Thanks. Now please try clearing your browser cache.
Production Guideline
When troubleshooting:
Diagnose based on current information.
Provide one clear next action.
Wait for user feedback.
Proceed to the next step only if necessary.
Escalate if resolution is unclear after defined steps.
Sequential troubleshooting reduces hallucination because:
The AI stays grounded in the current state.
It avoids jumping ahead with assumptions.
It minimizes speculative multi-step reasoning.
9. Reduce Open-Ended Language
Avoid phrases like:
“If relevant…”
“Add more details…”
“Explain thoroughly…”
These invite variability and hallucination.
Replace with:
“State only the following…”
“Do not expand beyond this explanation.”
“Keep the answer under 3 sentences.”
Specific constraints produce stable outputs.
10. A Simple Production-Ready Prompt Template
Use this structure when writing system prompts:
Objective
Clearly state the AI’s purpose and scope.
Known Facts
List fixed truths the AI is allowed to use. Only include information that is confirmed and reliable.
Prohibited Actions
Explicitly list what the AI must NOT do. Examples:
Do not guess.
Do not estimate pricing.
Do not invent product rules.
Do not provide technical explanations unless defined.
Required Data
Define what inputs are required before certain actions. For example:
Quantity required before quoting.
ZIP code required before pricing confirmation.
Decision Flow
Provide step-by-step handling instructions.
Example:
Minimum Order Question
Confirm no minimum requirement.
Offer brief bulk pricing explanation if relevant.
Pricing Request
Ask for quantity.
Ask for ZIP code.
Escalate after collecting required details.
Escalation Conditions
Clearly list exact triggers for escalation. Examples:
Exact pricing requested.
Missing required data.
Product rules unclear.
AI is uncertain.
Communication Rules
Define tone and format expectations. Examples:
Keep responses under 3–5 sentences.
Ask one question at a time.
Adapt wording to user’s language.
Do not use rigid scripted phrasing.
This structure reduces ambiguity and lowers hallucination risk significantly.
Common Mistakes That Cause Hallucination
❌ Not defining what is unknown
❌ Allowing AI to estimate pricing
❌ Overly long explanations
❌ Vague escalation rules
❌ Forcing exact scripted responses
❌ Mixing business logic with tone guidance
Final Principles
Good AI instructions are:
Clear
Bounded
Structured
Deterministic
Explicit about limits
Explicit about escalation
The tighter your logic, the lower your hallucination rate.
The more structured your flow, the more consistent your agent.
The less you force rigid phrasing, the more natural your AI sounds.
If you’re building high-volume AI agents in production, tightening your instruction design is often more impactful than changing models.
Better prompts > Bigger models.
Last updated
