Diagram of requests splitting into three routes: auto, human review, and human handling
Back to Work & InsightsComprehensive Guide

Confidence-Based Human-in-the-Loop Routing

Telling the model “don't make mistakes” doesn't change its error rate. It just hides the errors. Route by measured confidence instead.

TL;DR

  • Prompting a model to avoid mistakes doesn't make errors go away; it makes them harder to see. In production, some outputs will be wrong. The question is which ones reach the customer.
  • Score confidence on every output, then route explicitly: high → automatic, medium → a human reviews, low → a human handles it or the system asks for more information.
  • Confidence must come from signals you can check (schema validation, agreement between samples, retrieval scores, business rules) and be calibrated on your golden dataset. A model saying “I'm 95% sure” is not a signal.
  • Thresholds are a business decision: the cost of an error versus the cost of a review. Start conservative and widen automation as the data proves it safe.
Risk control · Typical API wrapper

Try to prompt the LLM into not making mistakes

Risk control · FDE architecture

Confidence-based human-in-the-loop with explicit routing

01 · Definition

Four parts of confidence routing

Confidence signals
schema ok · 3/3 samples agree · totals reconcile

Checks you can compute. Combined into one score per output, or per field.

Thresholds
≥ 0.9 auto · 0.6–0.9 review · < 0.6 human

Set per action, based on what an error costs. Sending a newsletter and issuing a refund get different bars.

Review queue
one screen, source + output + why flagged

Reviewers see the evidence and fix the output in one click, so reviewing is faster than doing it by hand.

Feedback loop
correction → golden dataset

Every human correction becomes training data for evals, prompts, and threshold tuning.

02 · Worked example

Invoice extraction into accounting, two ways

An SMB receives a few hundred supplier invoices a month. The AI extracts vendor, amounts, and due date into the accounting system.

A blurry, handwritten invoice where the total doesn't match the line items.
Prompt-only
Errors flow straight into the books
  1. 01Prompt: “Be very careful. Double-check all numbers.”
  2. 02Model returns a confident, well-formatted total
  3. 03Total is wrong; it's written to accounting
  4. 04Found at month-end reconciliation, if at all
Confidence-routed
Errors stop at a person
  1. 01Check: line items don't sum to total → score drops
  2. 02Check: two extraction passes disagree on due date
  3. 03Score 0.52 → routed to the review queue with both flags shown
  4. 04Reviewer fixes it in 20 seconds; the case joins the golden set

Clean invoices still flow through automatically. Humans only see the ones the checks couldn't vouch for.

function route(output: Extraction, src: Invoice): Route {
  const signals = [
    schemaValid(output),                       // 0 or 1
    lineItemsReconcile(output),                // sum(items) ≈ total
    agreement(output, secondPass(src)),         // 0..1 across fields
    vendorKnown(output.vendor),                // matches vendor master data
  ]
  const score = weightedScore(signals)          // weights fit on golden data

  if (score >= THRESHOLD.auto)   return { kind: "auto" }
  if (score >= THRESHOLD.review) return { kind: "review", flags: failed(signals) }
  return { kind: "manual", flags: failed(signals) }
}
Routing is a small, explicit function. The hard part is choosing signals and calibrating thresholds.
03 · Failure modes

Where HITL goes wrong

Self-reported confidence

Asking the model “how sure are you?” returns confident numbers that don't track actual accuracy.

Use external, checkable signals and verify on labeled data that high scores really are more accurate.

Review everything

Every output goes to a human. Reviewers start rubber-stamping and the AI saves no time.

Only uncertain outputs are reviewed, so reviewers pay attention to the ones that matter.

Silent errors

Wrong outputs look exactly like right ones and go straight to the system of record.

Low-confidence outputs can't reach the write step without a human decision.

Reviewers without context

The reviewer sees only the AI's answer and has to redo the work to check it.

Show the source, the output, and which check failed, side by side.

Frozen thresholds

Thresholds set on day one are never revisited, so automation never grows.

Review accuracy per band monthly; widen the auto band when the data supports it.

04 · Decision

Does your workflow need confidence routing?

Your score: 0 / 6

Automate with spot checks

Low-stakes output can flow automatically. Sample a few per week for quality and add them to your eval set.

05 · Trade-off

What it costs

Reviewer time
Someone has to own the queue, with a service level. Budget for it from day one.
Latency for flagged cases
Reviewed items wait for a human. Fine for invoices, not for live chat; design the user experience around it.
Calibration work
Thresholds need labeled data to set and periodic checks to keep honest.
Review UI
A good review screen is a small product in itself. A bad one makes review slower than doing the work manually.
06 · Playbook

How to set it up

  1. 01List the actions the AI takes and what an error costs for each.
  2. 02Choose two to four checkable signals per action: schema, reconciliation, agreement, known entities.
  3. 03Score your golden dataset and check that accuracy rises with the score.
  4. 04Set conservative thresholds: more goes to review at first.
  5. 05Build a review screen with the source, output, and failed checks side by side.
  6. 06Log every correction into the golden set; revisit thresholds monthly and widen automation as accuracy holds.

Tooling options

SMB · fastest start
Postgres queue + Slack/email alert

A status column, a simple internal page, and a notification. Covers most small teams.

Open source review
Label Studio / Argilla

Ready-made annotation and review interfaces you can self-host.

LLM-native
LangSmith annotation queues

Route traces to reviewers and turn their feedback into datasets.

Built-in
Your state machine

Make review a state with REVIEW_APPROVED / REVIEW_EDITED events; the audit trail comes for free.

More guides

Want this built into your workflow?

I help small and mid-size teams decide what to build, then build it, from the first eval set to production guardrails.

Talk through your use case