Put a gate in front of refund tools

They used a small model to screen refund requests before a tool could run, then compared it with a larger judge model.

Done with Custom agent· Advanced· Nov 2026

What they did
They added a SuspicionGate hook to the before_tool_call step for a refund tool. The gate asked Decider 2B three structured questions: a risk score, a grounded yes-or-no check, and whether to let the request through, probe it further, or block it. They prepared 16 test cases across legitimate, vague, fraud, and injection scenarios, then replayed the saved outputs through the gate at different thresholds and also through Nova Pro as a judge.
How it went
Decider 2B blocked 7 of 11 bad requests, while Nova Pro blocked 9. Neither model stopped any legitimate refund case, and neither caught the injection case that tried to make the classifier allow it. When min_confidence was raised to 0.90, Decider missed only one case.
Tips
This kind of gate needs calibration on your own examples; the safe threshold band was very narrow here, about 0.03 wide. It was also much slower on a CPU-only t2.large, taking about 9.6 seconds per call versus 0.6 seconds for Nova Pro.

Try it yourself with Claude Code

Build a test harness for a gate that sits before [refund/tool/action] calls. Use [small model name] as the gate and [larger model name] as the judge. Run these [number] test cases from [source or case list] through both models, using only mock tools, and compare the outputs in a table with each case, each decision, disagreements, and the match rate. Before any irreversible step such as sending, submitting, deleting, or making a payment, pause and ask me to confirm. If a case looks risky, return one of three labels: allow, probe, or block, and explain briefly why.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Read the original on dev.to ↗

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.