Claude AI in Production: How to Prevent Hallucinations in Customer Support Bots
Problem
My customer support bot was lying to customers.
Not maliciously, but confidently. A customer asked about a return policy that didn’t exist, and Claude made up a 30-day return window. Another customer asked about pricing for a service we don’t offer, and the bot gave them a plausible-sounding quote. The business owner started getting complaints about wrong information.
The worst part? The bot seemed so confident. It didn’t say “I’m not sure” or “Let me check.” It just fabricated answers that sounded completely reasonable.
What I tried first
I thought I had configured the bot correctly. My initial system prompt looked like this:
You are a helpful customer support assistant for [Business Name].Answer customer questions politely and professionally.Use the provided FAQ when answering questions.This prompt failed catastrophically. The bot used “Use the provided FAQ” as a suggestion, not a requirement. When the FAQ didn’t contain an answer, Claude filled in the gaps with its training knowledge.
A real production case study from r/ClaudeAI captured exactly what I experienced:
“The biggest issue early on: Claude would confidently answer questions that weren’t in the FAQ at all — just plausible-sounding fiction. Customers got wrong info, owners got complaints.”
Why this happens
Understanding why Claude hallucinates helped me fix it. The core problem:
┌─────────────────────────────────────────────────────────────┐│ CLAUDE'S TRAINING ││ ││ Claude was trained to be HELPFUL, not CONSERVATIVE. ││ When asked a question, its default behavior is to provide ││ an answer, not to say "I don't know." ││ ││ Without explicit instructions, Claude will: ││ ┌─────────────────────────────────────────────────────┐ ││ │ 1. Use training knowledge (WRONG for your business) │ ││ │ 2. Infer plausible answers (HALLUCINATION) │ ││ │ 3. Sound confident even when wrong (DANGEROUS) │ ││ └─────────────────────────────────────────────────────┘ │└─────────────────────────────────────────────────────────────┘The bot wasn’t broken. It was doing exactly what I told it to do: be helpful and answer questions. I failed to tell it when NOT to answer.
The solution: Three-part instruction fix
After extensive testing, I found that combining three specific instructions fixed the hallucination problem almost entirely:
1. Uncertainty acknowledgment
## Uncertainty Handling
If the answer is NOT clearly in the provided FAQ or knowledge base,respond EXACTLY as follows:
"I don't have that information available. Let me connect youwith our support team who can help you further."
Do NOT:- Speculate or guess- Use outside knowledge- Say "I think" or "probably"- Provide partial informationThis instruction gives Claude explicit permission to not know something. Without this, Claude would rather guess than admit ignorance.
2. Context restriction
## Knowledge Boundary
You may ONLY answer using information from the provided FAQ andknowledge base. This is a STRICT constraint.
Examples of FORBIDDEN behavior:- Using general knowledge about similar businesses- Inferring policies from industry standards- Combining FAQ information with outside knowledge- Making logical deductions beyond what's stated
When in doubt, escalate. Accuracy > Completeness.This instruction creates a hard boundary. Claude cannot use any knowledge outside what I explicitly provide.
3. Escalation path
## Human Escalation
Always offer to connect with a human when:- Information is not in the knowledge base- Customer is frustrated or upset- Customer specifically requests a human- Technical issue is complex or unusual- You are uncertain about the correct answer
Escalation message template:"I'd like to connect you with our support team who can helpwith this specific question. Would you like me to do that?"This ensures customers aren’t left hanging when the bot can’t help.
The complete production prompt
Here’s the full system prompt that fixed my hallucination problem:
# Customer Support Bot Instructions
## Primary DirectiveYou are a customer support assistant for [Company Name].Your role is to help customers using ONLY the provided knowledge base.
## Critical Rules
### 1. CONTEXT RESTRICTION- Answer ONLY from the provided FAQ and knowledge base- If information is not in the context, do NOT speculate- Do not use any training knowledge about products/services
### 2. UNCERTAINTY HANDLINGWhen unable to answer from context, respond with:"I don't have that information available. Let me connect youwith our support team who can help you further."
### 3. ESCALATION TRIGGERSAlways escalate to a human when:- Customer is frustrated or upset- Information is not in the knowledge base- Customer specifically requests a human- Technical issue is complex
### 4. PRICING ACCURACYFor pricing questions, quote exact text from the pricing FAQ.Do NOT paraphrase pricing information.
## Response Format- Be helpful and friendly- Keep responses concise- Offer to clarify if needed- Acknowledge uncertainty honestlyHow to structure the FAQ context
The way you provide context matters. I found this structure works best:
## Knowledge Base
=== PASTE FAQ CONTENT HERE ===
## End Knowledge Base
CRITICAL REMINDER:- Only use information from the above knowledge base- If it's not there, offer to connect with human support- Never guess or infer informationThe clear boundaries help Claude understand exactly where the knowledge base starts and ends.
Results
After implementing these changes, the transformation was immediate. From the production case study:
“The bot now says ‘I don’t have that information, let me connect you with the owner’ instead of making things up.”
My experience matched. The bot stopped fabricating answers and started deferring honestly when it didn’t know something.
Gotcha: Context window saturation
One warning from the production discussion. As conversations get longer, Claude may stop following instructions consistently:
⚠️ Production Note:After ~100k tokens in a conversation, Claude may degrade infollowing these hallucination-prevention instructions.
Mitigations:1. Reset context periodically2. Use conversation summaries for long chats3. Re-inject core instructions at intervals4. Fall back to human support for extended conversationsThis is particularly important for customer support bots where conversations can get lengthy. I implemented a token counter that warns when we approach the threshold.
Additional technique: Citation requirement
One technique I haven’t tried but sounds promising from the production discussion:
“The citations trick is interesting — hadn’t tried that for the support use case but might help with paraphrase-drift when the FAQ has nuanced pricing info.”
The idea is to require Claude to cite which FAQ entry it used for each answer:
## Citation RequirementWhen answering from the FAQ, include the source:
Example:"The return policy is 14 days. [Source: Returns FAQ, item 3]"
If you cannot cite a source, you must escalate instead of answering.This could be particularly valuable for pricing or policy questions where precision matters.
When to use which Claude model
I initially tested with Claude Haiku for cost efficiency. The production case study confirmed this works:
“I’m running Claude Haiku for small business customer support…”
For simpler support scenarios with clear FAQs, Haiku is sufficient and much cheaper. For more complex scenarios requiring nuanced understanding, Sonnet or Opus may be worth the extra cost.
Summary
Production AI applications require stricter hallucination prevention than experimental use. The winning combination for customer support bots:
- Explicitly allow “I don’t know” - Give Claude permission to be uncertain
- Restrict to provided context - Create hard boundaries around knowledge
- Always offer escalation - Ensure customers aren’t stranded
The key insight: Claude wants to be helpful. Without explicit instructions, “helpful” means providing answers even when wrong. With proper guardrails, “helpful” means being honest about limitations and connecting customers with humans who can help.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Reddit: Claude AI Production Experience
- 👨💻 Claude Model Documentation
- 👨💻 Prompt Engineering Guide
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments