Skip to content
JevDirectory.org
OfficialPractices & PatternsVerified 2026-09-20

Pattern: Confidence-Gated Routing

Use the answer to decide what to do and confidence to decide whether to act: the voice-banking example routes below 0.6 to a human and needs 0.85 or more to auto-approve a transfer.

Category
Practices & Patterns
Published by
TypeSafe AI
Author
Added
2026-09-20
Tagsofficialpatternsconfidenceroutingclassification

Highlights

  • Any intent below 0.6 confidence routes to a support agent before the action is considered.
  • check_balance is safe at 0.6 because the worst case is a wrong read-out.
  • approve_transfer needs more than 0.85, otherwise the user confirms first.
  • Thresholds are set per action by the consequences of a wrong classification.

Quickstart

python
if action.confidence < 0.6:
    route_to_support_agent(account_id)

elif action.choice == "check_balance":
    show_balance(account_id)

elif action.choice == "approve_transfer":
    if action.confidence > 0.85:
        approve_transfer(account_id)
    else:
        ask_user_to_confirm("Just to confirm: you would like to approve this transfer?")

Watch out

Confidence is not permission: a high-confidence answer can still be wrong, so keep hard limits next to the model for irreversible actions.

More like this

Classify intent with a Choice and complexity with a Score, then send each branch to deterministic code, a specialist model, or a person, with a 0.5 intent-confidence floor.
Practices & Patterns#official#patterns#routing
Official
Ask everything the system might need in one request, then let code throw away what it does not use. The ticket-triage example sends a category plus four speculative questions in parallel.
Practices & Patterns#official#patterns#batching
Official
Pick one option from a set you define. Returns the option, the full probability distribution, and 0-1 confidence, with up to 255 options and parallel questions that barely add latency.
Practices & Patterns#official#primitives#choice
Official
Back to all resources

From the community

Posts from builders shipping with Jev right now.

Full Jev video tutorial

The case against Jev-scored compaction

This is a terrible compaction strategy that fundamentally doesn't understand how compaction and context management work. Seems like a lot of people are confused so let's break this down. 1. Compaction isn't a filter The role of compaction is to clean up history to keep the Show more

tamara
tamara
@tamarajtran

found the perfect use case for @typesafeai Jev: instant compaction in 2026, why is compaction still a summarization prompt? Jev can make it instant by scoring every tool call and dropping what’s irrelevant

Reply