◉CLAUDE LABJP
●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/API & SDK
⬡ API & SDK/2026-06-25Advanced

When Your Support AI Is Confidently Wrong in Production — Notes on Refusing Outside Its Grounding and Routing to Humans

A field-tested approach to the Claude API support agent that demos perfectly yet states non-existent facts in production. Covers deciding 'don't answer' at retrieval time, grounded generation, measuring confident-wrong rate, and tuning escalation precision.

claude-api83customer-supportrag4groundinghallucination4escalationproduction111

✦ Premium Article

It demoed perfectly, yet states things that don't exist

Most teams remember the first internal demo of a support AI vividly. It answers every prepared question fluently, the tone is polite, and everyone feels the first response line can be handed over. The trouble starts after you trust that feeling and ship.

As an indie developer at Dolice running semi-automated inquiry handling across several blogs and apps, the case that chilled me most was an agent that confidently quoted the terms of a campaign that did not exist — complete with numbers. The user acted on it, then wrote back: "I did exactly what it said." Technically nothing failed. The response was a 200, the prose was smooth, the honorifics were correct. Only the content was wrong.

This quiet kind of error is not solved by a smarter model. Claude is plenty smart and it still happens. The cause is not a lack of intelligence; it is the absence of a mechanism that makes the system say "I don't know" when it doesn't. Below I split that mechanism into four parts — retrieval, generation, measurement, and escalation — in the shape that actually held up in production.

Why it can't say "I don't know" — the grounding misunderstanding

People often tell me they have RAG in place yet confident errors persist. Dig in and the structure is usually identical. You pull related documents from a knowledge base, stuff them into the prompt, and instruct "answer based on the resources below." That part is fine. But even when the retrieved documents barely relate to the question, generation does not stop.

The model tries to use whatever context you hand it. Given only weakly relevant documents, it assembles a plausible-sounding answer anyway. So the weak point of grounding is not generation — it sits one step earlier. The real hole is failing to judge, before generation, whether there is genuinely enough grounding to be worth answering at all.

I moved that judgment into retrieval as an explicit "answer or hand off" branch. Generation is just the final stage that only the things passing the branch ever reach.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A retrieval-confidence pattern that decides 'answer vs. hand off' before generation runs
✦How to measure confident-wrong rate from production logs, and the level to hold it under
✦Tuning escalation with precision/recall and F1 so you avoid both over-routing and misses
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ API & SDK2026-04-27
Production-Grade Hallucination Defense for Claude API: A Multi-Layer Architecture
Prompt engineering alone is not enough to suppress hallucinations in production. After a real customer incident, I rebuilt the system around four defensive layers — input grounding, tool-use escape hatches, citations, and post-hoc verification. This is the implementation playbook.
⬡ API & SDK2026-05-26
Stabilizing Claude API Structured Responses in Production — Notes on tool_use, JSON Schema, and Layered Validation
Getting Claude to return JSON takes a few lines. Keeping that JSON usable in production is a different problem. Here is the layered design I landed on after running a wallpaper classification pipeline through Claude API, built around tool_use, JSON Schema, and domain validation.
⬡ API & SDK2026-05-22
Why tool_result could not be submitted Keeps Coming Back, and How to Build a Recovery Handler That Actually Holds
Run a Claude agent long enough and one day it starts: 'tool_result could not be submitted', back to back, and retries change nothing. The error message hides four completely different root causes. Here is what I learned debugging it on the always-on agent jobs I run as an indie developer, with the TypeScript recovery handler I now ship in production.