<!-- Generated by scripts/i18n/translate.py from public/case-agents.md. Do not edit by hand: the next sync overwrites it. -->
# Case Agents: the wrong tool is not an acceptable approach 

> Markdown (GEO/AEO) version of <https://mauricio.issei.com.br/en/case-agents>. Author: **Mauricio Yokoyama Issei** · en-BR · Published: 2026-09-10 · Updated: 2026-09-19.

## In short

O **case-agents** is the implementation and benchmark of a routing brain for banking agent: decides if a query needs LLM, selects 2 tools between 285 registered and **blocks execution when the decision is not reliable enough**.

- **The ability is to choose the right tool; trust is to know when not to execute any.**
- **Catalog governance** — collapse of semantic duplicates in 14 canonical capabilities raised Hit Rate@2 from 35% to 100%.
- **The Silent Crash contained** — the Board of Directors (reading vs writing) prevented an e-mail consultation from changing the client's record.
- **Real cost savings** — 77.8% of economy with 100% success in executions.

## The problem and the domain

In the banking field, executing a wrong tool in the customer account is unacceptable. The routing brain needs to decide safely and abstain when confidence is insufficient.

## The barrier and the results

Four layers of security led the incorrect executions from 7 to zero, keeping 100% right in the 20 transactional queries and 77.8% cost savings in the MVP benchmark.

## The five statistical techniques

The decision is not made by an LLM. (1) TF-IDF with n-grams and logistic regression classify the message into FAST PATH or AGENT; (2) Platt staggering, with stratified cross-validation, calibrates the probability that the threshold of 0.75 means correct; (3) Cosine similarity in two fields, with collapse by capacity (maximum per group), chooses 2 tools between 285; (4) three thresholds — confidence ≥ 0.75, score ≥ 0.10 and relative margin (s1 − s2)/s1 ≥ 0.25 — plus a reading/writing steering guard decide when not to execute; (5) accuracy, confusion matrix, hit rate@k and percentage economy measure the result. The code explained is that of the branch feature/solucao-sluta (commit e2dcd7f). In this branch, the harness prints Precision@2 of 26.3% because it compares the name of the variant with the canonical name; recounted by capacity, are 20/20 in the top-2.

## Frequently Asked Questions

**What is the Case Agents project?**

It is the development and evaluation of the brain routing and selection of tools of a digital banking service agent. It classifies the message in FAST PATH or AGENT, retrieves the 2 most relevant tools between 285 and applies a 4-layer pre-execution barrier before calling any LLM.

**What is Silent Crash measured in the project?**

A failure in which a query query ("What is the email registered in my account?") resolved with high confidence and slack margin (0.47) for the registration change tool (update email). The failure went through 54 tests and 3 traditional guards without generating exception.

**How does the steering guard work?**

The Direction Guard (G4) analyzes the query verb and compares it to the mode of operation (read/write) stated in the tool. If the query is read and the tool is written, the system completely discards the tool to prevent irreversible damage to the client's registration.

**How to achieve 100% success with cost savings?**

Declaring the governance of the tool catalog (collapse of semantic duplicates in canonical capabilities) and applying the 4-layer pre-execution barrier (router confidence, minimum score, relative margin and direction). Net cost savings were 77.8%.

**What is the strategy of two branches of the project?**

The repository maintains two approaches in Git: a branch feature/solucao-swine, focused on rapid prototyping and validation of hypotheses with lean code, and the branch main (solucao-sdd-vibe), focused on robustness enterprise with Spec-Driven Development, 9 ADRs, canonical taxonomy, Platt Scaling calibration and blueprint of productive architecture.

**How does High Performance Production Architecture (ADR-009) work?**

The productive architecture rigidly separates Cold Path (training and calibration in Python 3.12 offline/CI) from Hot Path (OmniRoute Inference Gateway in Rust/Go stateless online). With built-in in-process engine, the hot path reaches latency p99 below 1-3 ms, eliminates Garbage Collection pauses and runs the guard rails directly in RAM memory.

## Glossary

- **Pre-Execution Barrier** — Set of 4 deterministic guards authorising or diverting the execution of a tool before invoking the LLM.
- **Steering Guard** — Semantic restriction that prevents writing tools (state change) in read requests.
- **Capacity Collapse** — Grouping of redundant operational variants under a unique canonical capacity.
- **Cold/Hot Path Decoupling** — Architectural pattern that isolates offline Python training from the gateway compiled in Rust in critical production path.

*© 2026 Mauritius Yokoyama Issei. Citable content with assignment (fair use educational).*
