> ## Documentation Index
> Fetch the complete documentation index at: https://secndai.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://secndai.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://secndai.manicule.dev/api/mcp.
> Every agent surface: https://secndai.manicule.dev/.well-known/llms-manifest.json

# Confidence routing (/patterns/confidence-routing)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 272 · updated: 2026-11-12 -->
Related: [Escalate to a human](/patterns/escalate-to-human.md), [Companion true/false check](/patterns/companion-check.md), [Batching and concurrency](/patterns/batching.md), [Where the model fails](/honest-limits.md)

> 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.

```python
# 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](/confidence) for the exact comparison and the meaning of `confidence` in this version.
