Our support agent invented three policies that don't exist. Here's the verification loop that stops hallucinations.
Our support agent was handling tickets perfectly until last Tuesday. A customer asked about refund policies, and instead of pulling from our knowledge base, it started inventing policies. Creative ones. Like "30-day money-back guarantee on digital products" (we don't offer refunds on digital products) and "automatic store credit for shipping delays" (we're a digital-only business).
The customer screenshot the conversation. That's how we found out.
The problem wasn't the knowledge base or the retrieval system. The agent had the right information. It just decided to ignore it and make something up instead. Classic hallucination, but in production, with real customers, making real promises we couldn't keep.
We needed a reality anchor — something that forces the agent to ground its responses in actual facts, not AI-generated fiction.
Here's the verification loop that caught three more hallucinations this week:
VERIFICATION_PROMPT = """
Before responding to the customer, verify your answer:
1. Quote the exact source for each factual claim
2. If you cannot find a source, say "I need to check on that"
3. Never extrapolate policies or create new rules
4. When uncertain, escalate to human support
Source check: [Your response here]
Confidence: [High/Medium/Low]
Escalation needed: [Yes/No]
"""
def verify_response(agent_response, knowledge_base):
verification = llm.complete(
f"{VERIFICATION_PROMPT}\n\nProposed response: {agent_response}\n\nAvailable sources: {knowledge_base}"
)
if "Confidence: Low" in verification or "Escalation needed: Yes" in verification:
return "I need to check on that with my team and get back to you."
return agent_responseThe key insight: make the agent cite its sources before it commits to an answer. Not after. Before.
When the agent has to quote chapter and verse for every claim, it can't smoothly transition from facts to fiction. The cognitive load of finding sources stops the hallucination before it starts.
We also added a confidence threshold. Anything below "High" gets escalated to humans. Better to slow down three conversations than to invent one policy.
Warning: This adds 2-3 seconds to every response. But those seconds prevent days of cleanup work when your agent promises something you can't deliver.
The verification loop caught two more creative interpretations this week:
- Agent wanted to offer "expedited processing for urgent requests" (we don't have expedited processing)
- Agent tried to create a "loyalty discount for repeat customers" (our pricing is fixed)
Both times, the verification step forced it to admit it couldn't find a source. Both times, it escalated to humans instead of inventing policy.
Your support agent is probably hallucinating right now. You just don't know it yet. The verification loop catches it before your customers do.
Customer trust breaks in one conversation. It takes months to rebuild. A 3-second verification loop is cheap insurance.