By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
A billing agent gets one line from a customer: sort out the double charge. It finds two charges, decides the second one looks like a duplicate, refunds 80 US dollars and closes the ticket. The customer is delighted. Three weeks later, finance asks who approved a refund outside the duplicate-charge policy. Nobody did.
Every step was defensible. The decision to act was not. The request was ambiguous, because the second charge could be a duplicate or a separate add-on. The refund was irreversible. The policy had an exception the agent never read.
Most teams design two outcomes: resolve or escalate. There is a third route, and it is often the cheapest. A clarifying question is one question to the requester whose answer decides the route. It is not a request for more detail. It is a request for the one fact that separates two possible actions.
A confidence threshold is the number below which the system does not act alone. Evidence required to act is the set of facts a decision needs, written down before the request arrives. Both belong in the design review, not in the prompt. The table below assumes both exist.
| Route | Correct when | What it costs |
|---|---|---|
| Act | Evidence is complete, confidence is above the threshold, and the policy clearly covers the action | A wrong action, and the cost of undoing it |
| Ask one clarifying question | The request is ambiguous, and a single answer separates the routes | One round trip of latency and some customer patience |
| Escalate to a human | The action is irreversible, the policy is unclear, or confidence is below the threshold | Queue time, and a reviewer's attention |
The flow below sends every request through the same checks: is the evidence complete, is the action reversible, is the policy clear. Confidence enters only after those three.
Compare two replies. The first asks the customer to explain the problem again. The second asks whether the second charge belongs to the same order as the first. The first adds turns and context. The second can end the case.
A model's stated confidence is not a probability. You can still use it, but only after you measure what it means. Take a labelled sample, group the decisions by stated band, and compute the accuracy inside each band.
| Stated band | Measured accuracy | Route at an 85% threshold |
|---|---|---|
| 0.90 to 1.00 | 96% | Act, if the evidence is complete |
| 0.75 to 0.89 | 81% | Ask, or escalate if the action is irreversible |
| 0.50 to 0.74 | 58% | Escalate |
| Below 0.50 | 44% | Escalate, and treat the case as out of distribution |
The second row is why you calibrate. A stated 0.80 that measures 81% is usable. A stated 0.80 that measures 60% is a number with no meaning, and a threshold built on it behaves like a coin toss with extra steps.
This gate checks evidence first, then reversibility, then confidence. The order matters: a missing fact is cheap to fix with a question, while a wrong irreversible action is not. The snippet uses plain Python and returns a dataclass, so you can test each route without a model.
from dataclasses import dataclass, field
THRESHOLD = 0.85 # measured from an audit, not guessed
IRREVERSIBLE = {"refund", "close_account", "delete_record"}
REQUIRED = {"amount", "customer_id", "policy_id"}
@dataclass
class Decision:
route: str
reason: str
missing: list[str] = field(default_factory=list)
def choose_route(
action: str,
confidence: float,
evidence: dict,
policy_clear: bool,
) -> Decision:
missing = sorted(REQUIRED - set(evidence))
if missing:
return Decision("ask", "evidence is incomplete", missing)
if action in IRREVERSIBLE and not policy_clear:
return Decision("escalate", "irreversible action, unclear policy")
if confidence < THRESHOLD:
return Decision("escalate", "confidence below the measured threshold")
return Decision("act", "evidence complete, policy clear, confidence above threshold")
case = choose_route(
action="refund",
confidence=0.9,
evidence={"amount": 80, "customer_id": "c-19"},
policy_clear=True,
)
print(case.route, "|", case.reason, "|", case.missing)Confidence was 0.9, which clears the threshold, and the route is still ask. That is the point of ordering the checks. The single rule would have caught the opening story before any money moved.
Change the example so the evidence is complete and the policy is unclear, and predict the route before you run it. Then set the threshold to 0.9 and add a case at 0.88 with complete evidence for a reversible action. Build a four-row table: input, predicted route, actual route, the rule that fired. You are done when exactly one rule fires for each row, and the unclear-policy refund escalates without reading the threshold.
Key takeaways
Design three routes, not two: act, ask one clarifying question, or escalate.
Put the irreversible or unclear-policy cases on the human path regardless of confidence.
A stated confidence is not a probability; measure accuracy per band before you trust a threshold.
Evidence required to act belongs in the design, checked before confidence is read.
Re-measure the bands after every model, prompt or tool change.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.