Skip to content
JevDirectory.org
Practices & Patterns#confidence#routing#evaluation#architecture

Confidence Gates in Production: Thresholds That Match the Cost of Being Wrong

Confidence is not accuracy, and a single global threshold is rarely the right policy. A practical guide to per-action gates, measured thresholds, and the logs you will want later.

The reason to use Jev is not that it classifies text cheaply. Plenty of models do that. The reason is that every answer carries a confidence value, and code can use that value to decide whether to act at all.

That sounds simple and gets subtle fast. This is a practical guide to setting those gates: where thresholds come from, how to keep them honest, and what to log so you can tune them later.

The three-way branch

The confidence pattern uses a voice-banking example that is worth internalizing. One request classifies the intent and reports confidence. Then code branches three ways:

  • Below 0.6 confidence on any intent, route to a support agent. The model's uncertainty is the routing signal.
  • At 0.6 or above, a low-stakes action like check_balance is safe. The worst case is a wrong read-out.
  • For an irreversible action like approve_transfer, require more than 0.85 confidence, otherwise ask the user to confirm first.

The point is not those exact numbers. The point is that each action gets its own gate, because each action has its own price for being wrong.

ActionCost of a wrong answerGate
Read a balance aloudLow, user notices immediately0.6
Route a support ticketMedium, human can re-route0.6
Approve a transferHigh, funds move0.85 plus confirmation
Delete a recordHighest, unrecoverableHuman in the loop

Confidence is not accuracy

Confidence measures the model's certainty in its own answer, not the probability that the answer is correct. The jaggedness list makes this concrete: complementary probabilities can sum past 1 (a refund question once read 0.72 and 0.47 across two formulations), and the same judgment can disagree across primitives. A confidence of 1.0 describes where the probability mass sits, nothing more.

The design consequence: never use confidence as the only protection for an irreversible action. Keep a hard rule, a permission check, or a human next to the model. Confidence decides whether to ask a person; policy decides what a person is allowed to approve.

Pick a gate you can defend

Intent routing adds a second gate worth copying: route below 0.5 intent confidence to a human, and use a separate complexity Score to decide whether a confident request goes to deterministic code, a specialist model, or a person. That gives you two independent reasons to escalate, low confidence and high complexity, instead of one number doing all the work.

When you choose a threshold, write down the two error costs next to it. A false yes and a false no rarely cost the same, and asymmetry is what moves a threshold off 0.5. If a false yes is expensive, raise the gate and accept more human review; if a false no is expensive, lower it and accept more noise.

Measure before you tune

The self-consistency cookbook is the best available template for threshold work. It runs the same 8-question moderation rubric 15 times per condition and reports that Jev's mean probability standard deviation is 0.0098, against 0.0245 to 0.0543 for the LLM distributions it compares. Routing anything below 0.60 probability to an uncertain bucket lifted policy agreement from 90.8% to 99.2%, while still labeling 74.2% of cases automatically.

Two lessons. First, repeatability is not accuracy: run the same case many times and watch whether the confidence moves before you trust a boundary. Second, a gate trades coverage for agreement, and you can measure both. The cookbook even caught Jev flipping its top label across its own repeats, which is exactly the behavior a gate is designed to catch.

Log the inputs to the gate

A threshold is a policy, and policies drift when nobody can replay them. This engineering note on Jev in the agent runtime suggests logging four things together: the state snapshot, the question version, the confidence, and the policy version. With those on hand, an incident review can tell whether the state changed, the question changed, the model changed, or the threshold did.

Pin the model version while you are at it. jev-latest moves; a gate tuned against one release can behave differently against the next. Community walkthroughs like this practical guide pin jev-1.13.0 after tuning for the same reason.

Start here

  1. Pick one action and one gate.
  2. Write down the two error costs next to it.
  3. Log state, question version, confidence, and policy version.
  4. Run the same labeled cases repeatedly before trusting the boundary.
  5. Keep a human path for the middle band, and a hard rule for anything irreversible.

From the directory

The resources behind this article.

How TypeSafe reports certainty, how it differs from probability, and how to use it architecturally to gate and route decisions.
Practices & Patterns#official#confidence#routing
Official
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.
Practices & Patterns#official#patterns#confidence
Official
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
A maintained list of jev-1.13's known failure modes, literal reading, unreliable counting, dates as text, indirection, context rot, and contradictory criteria, each with a guardrail.
Practices & Patterns#official#docs#evaluation
Official
A repeatability study: an 8-question moderation rubric run 15 times per condition shows a mean probability standard deviation of 0.0098, and a 0.60 uncertainty gate lifts agreement to 99.2%.
Cookbooks & Demos#official#cookbook#consistency
Official
Back to all articles

More articles

The most common Jev design mistake is asking a question that does not match the primitive. Here is how to choose by the shape of the answer you need back.
Practices & Patterns#primitives#choice#score
Read article
Jev cannot count, reads dates as text, and takes instructions literally. These are not bugs to work around quietly; they are design constraints with known guardrails.
Practices & Patterns#evaluation#state#dates
Read article

From the community

Posts from builders shipping with Jev right now.

Vercel's fx safety reviewer, 18x faster

We're seeing extraordinary results from @typesafeai. Default mode in 𝚏𝚡 is auto, with a safety reviewer analyzing every command. That reviewer runs on GPT Luna today. Jev is up to 18x faster (p95) *and* more accurate. It's coming to @vercel AI Gateway and likely new default.

Pranit
Pranit
Vercel
@fazxes

We benchmarked fx auto mode (safety) classifier with @typesafeai's Jev. tl;dr: ~5-18x faster and more accurate than 𝚐𝚙𝚝-𝟻.𝟼-𝚕𝚞𝚗𝚊, our current top choice

Image
Reply

Jev lands on OpenRouter