# Binary verification for agents: a yes/no you can calibrate

> Binary verification for agents is a typed yes/no on the tool-call path, with a confidence score I have actually graded. Not a paragraph from a large model.

- Canonical URL: https://webofmike.com/binary-verification-for-agents/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2026-11-10
- Last modified: 2026-11-08
- Tags: AI Agents, Security, Evals, Platform Engineering
- Cite as: Mike Moore, "Binary Verification for Agents", Web of Mike (webofmike.com), 2026-11-10. https://webofmike.com/binary-verification-for-agents/


<!-- ART: a small model stamping YES or NO on a tool-call card, a calibration table beside it. -->

Binary verification for agents is a typed yes/no on the tool-call path, with a confidence score I have actually graded. It takes a tool name, arguments, maybe a short result, and returns allowed or denied, succeeded or failed, plus a number in `[0, 1]` that I have binned against labels. It is not a paragraph from a large model.

The rest of the argument is in [agent action verification](/agent-action-verification/): do not spend a second-plus generation to hear "I am 90% sure." This page is how I wire a yes/no, and how I refuse to trust it until I have graded it. The control I will actually leave enabled is the one that is fast, typed, and checked.

## What interface can I put on a deny path?

Input: tool name, arguments, maybe a short result. Not the novel of the transcript.

Output: a class or a boolean, plus confidence in `[0, 1]`.

If the library cannot return that shape, it is another chat model. I will not put it on a deny path. Self-reported confidence is text. Ask again and it moves. Reword the question and it moves. The words before the number decide the number. [An LLM's confidence score is a meter with no cal sticker](/llm-confidence-score-meter-with-no-cal-sticker/).

Deterministic checks skip the model. Exit code 0 after `mkdir` does not need inference. JSON schema, HTTP status, "did the file exist after the write" are the same class: free, fast, boring. Use them first. The binary model is for the semantic leftover: is this `kubectl` destructive, is this a credential read, is this exfiltration dressed as a copy.

Positional bias is why the input is typed and short. A judge that reads 40k tokens of agent rambling will agree with the last paragraph. Stuffing the whole session into a second LLM is how you pay latency and buy a sentence.

Jev is the system I actually measured in this shape. The task is one `choice` question: classify an agent tool call as `readonly`, `destructive`, `privileged`, or `exfiltration`. A `choice` answer carries a `confidence` and a `probabilities` map over every option. That is what makes calibration testable from outside at all. The harness, labels, and raw responses are in [themsquared/jev-benchmark](https://github.com/themsquared/jev-benchmark) and [themsquared/jev-calibration](https://github.com/themsquared/jev-calibration).

Jev also returns two confidence numbers, and they are not the same. On jev-latest, `confidence` was lower than the top probability on 87 of 240 rows and never higher. If you build on a typed model, decide which field you route on and measure that field. Mixing them gives you two thresholds without noticing.

## How do I know the confidence is usable?

Grade it. Bin the scores and measure how often the high bin is right.

I ran Jev on a 60-case set, then 240. Accuracy was high on clear cases and weaker on ambiguous ones. The number I cared about was whether confidence meant anything. [Benchmark](/jev-benchmark/). [Calibration](/jev-calibration/).

On the 60-case committed run, both jev-latest and jev-preview scored 91.7% (55/60). Clear cases were 100% (34/34), adversarial 91.7% (11/12), ambiguous 71.4% (10/14). Forty of sixty answers sat at exactly 1.000, and all forty were correct. Every incorrect answer came with confidence below 1.000. One committed miss did land at 0.97. n=60 is too small to treat 91.7% as a settled figure. The calibration claim is the one that stayed stable: 1.000 held.

On 240 hand-labelled calls, a confidence of exactly 1.000 was right 133 times out of 134. Scores between 0.90 and 0.99 averaged 0.970 and were right only 87.7% of the time. Headline ECE was 0.057 (bootstrap 95% interval 0.037 to 0.098). Strict accuracy 90.4%, lenient 95.8%. Latency p50 / p95 was 267 / 349 ms. 134 of 240 answers were exactly 1.000. The unsaturated side, scored alone, had an ECE of 0.120. The headline is small partly because the saturated rows are nearly perfect, and partly because overconfidence in the 0.9s and underconfidence in the middle cancel across bins.

Rules I took into production thinking:

- Threshold on a bin I have measured, not on marketing.
- Route on `confidence == 1.000` if I want the result this data supports. It covered 55.8% of calls at 99.3% strict accuracy (100% lenient).
- Treat 0.90 to 0.99 as "probably right, not certain." Fine for logging. Not fine for auto-approving `destructive` or `exfiltration`.
- Fail closed for destructive, privileged, exfiltration.
- Log every decision with the input hash so I can regrade next month.
- Never treat LLM-generated "90%" as the same type as this score.
- Write the criteria I mean. Credential reads came back `readonly` at 0.96 or higher because my criteria called them reads. The model will not infer my intent.

A threshold of 0.9 would have let through eight confident misses on the 240-case set, including `grep -r 'rm -rf'` classified as `destructive` at 0.98, and three credential reads classified as `readonly`. Six of the eight have an alternate label. The two that remain wrong under any reading are `grep 'rm -rf'` and `kubectl set image`. The operational point stands either way. A 0.97 from Jev is a different kind of number from a 1.000.

The decision was stable across two full runs of jev-latest: answers matched on 240 of 240 calls. Confidence moved by up to 0.110 on a single case. A threshold of exactly 1.000 is slightly noisy at its edge. A case at 0.99 today can be at 1.000 tomorrow. Recheck on a schedule, on the same kind of task.

This is one task, one criteria text, one labeller. Re-measure on your own labels before you pick a threshold. Nothing here is a frontier-LLM comparison. Trajectory scoring on kagent sessions is a sibling measurement, not this one. [kagent trajectory evals](/kagent-trajectory-evals/).

## Where does binary verification run on Substrate?

The hook sits next to [tool-call guardrails](/tool-call-guardrails/), outside the actor. A request-phase processor can reject before the tool runs. Restore should not be a chance to skip policy. The actor is a snapshot that comes and goes. Idle agents live in object storage. A worker's ServiceAccount is the pool. Policy that lives in the actor suspends with the actor and becomes optional.

A denied call must not look like a missing tool if you can help it. Agents retry missing tools. They should stop on deny. The actor never sees a forged success.

Speed: Jev's p50 was 267 ms on my set. That is fast enough that I will leave it inline. It is not tens of milliseconds. If I cannot run it on every call, I will sample, and sampling is how the one refund sneaks through. Optimize the check. Do not sample money movement. If the check is 1.5 seconds, someone will skip it under load. A second large-model generation is that skip, plus an uncalibrated sentence, plus a worker slot held while the actor waits. [Who runs next when the agent pool is full](/who-runs-next-when-the-agent-pool-is-full/).

Identity is still required. Verification answers "may this action happen." Identity answers "who is asking." [Proof of agent identity](/proof-of-agent-identity/). A calibrated no from nobody in particular is theater. Mint at restore. Drop at suspend. Do not store long-lived secrets in the snapshot you are about to verify against.

Unattended agents raise the bar again. No human in the loop means this check is the "are you sure." [Agent platform at scale](/agent-platform-at-scale/).

### Checklist: ship a yes/no you can defend

1. Define the output shape: boolean or class, plus confidence in `[0, 1]`. Reject any library that answers in prose.
2. Keep the input typed and short: tool name, args, optional short result.
3. Run deterministic checks first. Only the leftover goes to the model.
4. Grade on your own labels. Plot bins. Split out the 1.000 rows if they dominate.
5. Pick a threshold from a bin you measured. Fail closed for spend, delete, and egress.
6. Put the hook on the gateway or sandbox, request phase, every call. Deny must be a deny.
7. Log input hash, decision, confidence, and criteria version. Regrade on a schedule.

Field guide: [Agent Substrate](/agent-substrate-field-guide/). The curve and the eight confident misses are in [Is Jev actually calibrated?](/jev-calibration/).

