All writing
AI EngineeringOctober 14, 20264 min read

Grade the Bot Before You Switch It On: Shipping a Claude Support Assistant Behind an Eval Gate

We replaced Intercom's AI agent with our own Claude-powered assistant. The rule was simple: it stays off until it answers real past questions correctly at least 60% of the time.

Henry Iddirisu

Henry Iddirisu

AI product engineer

Real past conversations scored against AI answers, with a pass gate at 60 percent

The demo always works. That's the problem.

When we moved student support from Intercom to our own platform, we also replaced Intercom's AI agent with our own, powered by Claude. Building the assistant was the quick part. Deciding when it was allowed to talk to students was the real work.

A support bot that answers wrong is worse than no bot: the student gets a confident, incorrect answer and a worse experience than waiting for a person. So the assistant shipped off, behind a rule agreed before anyone saw a result:

It stays off until a graded sample of real past questions is at least 60% correct.

1. Design the exits first

Before the eval, the assistant itself was built to fail safely:

  • One read-only call. Claude gets the student's question, a student card with no contact details, and reviewed knowledge. It returns a JSON answer with a confidence score. It can't change anything.
  • Confidence threshold. Below it, nothing is posted, and the conversation goes to a person.
  • Errors go to a person. A timeout or malformed response never becomes a reply.
  • Every answer asks. Each reply ends with "Yes, solved / No, talk to a person", so a wrong answer costs the student one tap, not a dead end.
  • Every answer is recorded with its outcome, so we can see real resolution rates later. Answers nobody rates are settled automatically after seven days.

The eval measures the assistant with these exits. If the threshold suppresses an answer, that conversation simply goes to a person, so the score that matters is accuracy among the answers it would post.

2. Evaluate on your own history, with production code

Generic benchmarks say nothing about your students' questions. We had something better: the full history of real conversations in Intercom, already exported for the migration.

support:ai-eval turns that history into a test set:

  1. Pick real pairs. Conversations a student opened and a person answered.
  2. Ask the production assistant. The student's opening message goes through the same code path as a live answer, with the same prompt and model call. The only difference is that nothing is posted. Usage is tagged separately, so eval runs don't pollute production numbers.
  3. Write a sheet. For each case: the question, the human answer, the AI answer, whether it would have posted, and an empty grade column.

The point of reusing the production path is simple: a separate eval script drifts from the real assistant, and then you've evaluated something you don't ship.

3. A person grades, the tool decides

Grading support answers needs judgment, like "is this the same policy, stated differently?", so a person fills in the grade column. Then:

php artisan support:ai-eval --grades=eval.csv

reads the sheet back and prints the share of correct answers among the would-post rows, with PASS or FAIL against the 60% gate. No arguing with a spreadsheet: the rule was set first, and the tool applies it.

4. Then roll out like a migration, not a launch

Passing the gate doesn't mean switching Intercom off. The assistant, the inbox, and the apps all sit behind flags. A public bootstrap endpoint tells each app which chat to open (Intercom, both, or in-house), and the runbook plans a two-week dual run with a rollback path before anything is cancelled.

What I'd tell anyone shipping an AI assistant

  1. Build the exits before the answers. Confidence threshold, error hand-off, and a "talk to a person" on every reply.
  2. Set the bar before you look at the results. A number agreed in advance stops you rationalizing a weak score.
  3. Evaluate on your own history through the exact production code path.
  4. Measure what users will actually see: accuracy among the answers that would post, not all answers.
  5. Roll out behind flags, run old and new side by side, and keep a way back.
#claude#llm#evals#customer-support#laravel
Henry Iddirisu

Henry Iddirisu

AI product engineer · Accra, Ghana · Remote

Keep reading