Skip to content
Secnd

Confidence routing

Use the returned action to choose automation or review.

Define the wrong-action cost first. Select a threshold on representative development data; keep the final evaluation set separate. A threshold copied from an example is not a validated policy.

# result is the response from client.decide(...).
if result["action"] == "ask_human":
    next_step = {"kind": "review", "candidate": result["choice"]}
else:
    next_step = {"kind": "route", "queue": result["choice"]}

Your code consumes next_step after checking allowed queues and user permissions. Keep that code separate from probability interpretation so a model response cannot invent a queue or bypass policy.

Log the resolved model and effective threshold alongside the final outcome if permitted. Monitor reviewed mistakes and distribution shifts. Retune on development data when a model, option set, or business rubric changes.

Do not overwrite ask_human with a lower local threshold. Read confidence and the gate for the exact comparison and the meaning of confidence in this version.