Route First, Respond Later: Fail-Closed Routing for LLM Customer Service SoftwareRoute Before Response: Fail-Closed Routing for LLM-Enabled Customer-Service Software
The authors propose RouteBR: the model proposes a route, deterministic code validates state and objects before dispatching; on 200 CONFIRM MAIN cases the final-path exact match is 97.5%, and among 166 non-dispatch cases there are 0 false dispatches.
The customer-service entry point of a financial institution must select a downstream service before replying; the paper focuses on routing errors at the integration boundary: false dispatch (should stop but dispatches) and false block (should dispatch but is blocked). The model only submits a semantic proposal; deterministic code decides DISPATCH or CLARIFY/DEFER/HANDOFF/REJECT based on versioned state and rules; the paper does not posit an adversarial attacker and studies routing correctness and safety under state and policy.
- A financial institution's LLM customer service must select a downstream service before replying, but matching a service does not mean the current state and policies permit dispatch, and entities may also fail to map to a registered identifier; classifiers and LLM routers only give a label or destination and lack permission and registration validation before dispatch.
- RouteBR lets a single model call only propose the main service action and the registered object; deterministic code then performs state gating according to versioned rules, validates the object against a closed list, and then decides dispatch or one of four non-dispatch outcomes; lower-ranked candidates cannot replace a blocked main route. The authors built a 600-case privacy-preserving scenario benchmark.
- On 200 CONFIRM MAIN cases, RouteBR's final-path exact match is 97.5%, versus 95.5% for B2 with the same information (difference not significant, p=0.344); rule-free B1 has 94.0% action accuracy but only 41.0% path accuracy; among 166 non-dispatch cases, RouteBR has 0 false dispatches; the six backends' path scores differ within 1.9 percentage points.
- The authors state that the scenarios come from a single institution, that states and policies are synthetic, and that inter-annotator agreement was not computed; transfer is limited by the closed ontology, equality predicates, a single submission object, and hosted backends; evaluation on other languages, catalogs, and new checkpoints is left for future work.
- Evaluated models
- DeepSeek V4 ProDeepSeek V4 FlashQwen3.8 MaxGPT-4oQwen3.7 PlusGPT-5.2
- Benchmarks
- 600 例隐私保护客服场景基准(DEV/SELECT/CONFIRM,含 MAIN、FLIP、ENTITY 视图)
- Metrics
- final-path exact matchmacro-F1action accuracyfalse dispatchfalse blockFLIP pair accuracyobject accuracyvalid JSONcallstokenslatency
The researchers propose RouteBR, a pre-response routing controller for LLM customer service software in financial institutions: model calls only propose a primary service action and a registered object, deterministic code validates identifiers and versioned rules before dispatch, failures enter a designated no-dispatch outcome, and a blocked primary route cannot be replaced by a lower-ranked candidate. The team built 600 privacy-preserving scenarios from common confidential request patterns at a real financial institution, with three engineers jointly reviewing the scenarios and labels. On the 200-case CONFIRM MAIN split, RouteBR achieves a 97.5% exact final-path match rate, versus 95.5% for a single-call baseline under the same rules, while a rule-free program's diagnostic baseline achieves 94.0% action accuracy but only 41.0% exact final-path match rate; among 166 MAIN and FLIP cases that should not be dispatched, RouteBR made no erroneous dispatches. The implementation is open-sourced at https://github.com/YgcCoder/RouteBR。
Paper analysis
What problem does this paper attempt to solve?
The authors study the routing boundary before customer-service software replies: a service-match request does not mean dispatch is permitted; code must verify state, rules and the registered object.
Core problem: an LLM customer service entry point must select a downstream service before replying, but a semantically matching service is not necessarily permitted by the current software state and policies, and a referenced entity may not map to a registered identifier.
- Scenario and importance: a financial institution's customer service entry point connects information query, account analysis, consultation, support processes, and protected operations, forming a software integration boundary that passes requests, identifiers, and responsibility to downstream components. In Figure 1, the request and object are fixed and only permission changes from true to false, and the result changes from DISPATCH to REJECT, showing that correct routing depends on runtime information beyond the request text.
- Shortcomings of existing methods (per the paper): intent/out-of-scope methods return labels or refusals, LLM routers select a destination, tool-use methods produce calls and arguments, entity linking gives identifiers, and runtime controls constrain subsequent transitions; the authors argue that without an independent pre-dispatch validation layer, these outputs cannot form a complete executable route.
- Core observation: routing errors change executable software behavior; false dispatch sends out a request that should be stopped, false block stops a request that should be dispatched, and even valid JSON may point to an unknown object or an operation forbidden by the state.
- What the paper proposes: the RouteBR controller—one model call proposes the primary service action and registered object, deterministic code validates identifiers and versioned rules before dispatch, and lower-ranked candidates cannot replace a blocked main route; it also builds a 600-case privacy-preserving scenario benchmark.
- Problem setting (non-adversarial): the paper does not posit an attacker; the object of study is the routing decision at the boundary. The input is the request, history, service catalog, registered objects, runtime state, and versioned rules, and the output is a permitted action–object dispatch or one of four non-dispatch outcomes (CLARIFY, DEFER, HANDOFF, REJECT).
What related research exists?
Related work falls into four groups: customer-service tasks, semantic routing and tool calling, entity linking, and runtime control; the authors state that this paper evaluates five types of properties together in a pre-dispatch decision.
Customer Service Task Formulations
- Financial QA benchmarks (FinQA, FinanceBench) evaluate answers over documents and tables; task-oriented dialogue (MultiWOZ 2.1, SGD, Taskmaster-1) represents services as intents, slots, states, and API parameters.
- Intent detection, out-of-scope, and selective prediction (Larson et al. 2019, Casanueva et al. 2020, Geifman and El-Yaniv 2017) add labels or refusals. The paper notes that these tasks mainly aim to infer answers, labels, or calls from dialogue, whereas this paper's boundary treats runtime state as an independent versioned software record, enabling pairwise tests with fixed request-side input and only one predicate changed.
Semantic Routing and Tool Calling
- Autoregressive semantic routing planning (Zhao et al. 2024) predicts navigation paths; LLM routers (RouteLLM) select a model or service, and guarded variants (Guarded Query Routing, etc.) add refusals or prompt-optimized routing behavior.
- Tool-use benchmarks (API-Bank, ToolLLM, Gorilla, ToolQA) evaluate interface selection, parameters, execution, or API sets; τ-bench combines interaction, tools, policies, and final database state. The paper notes that router evaluations often only ask whether the destination is appropriate, whereas this paper requires the action, canonical object, versioned state, and terminal state to agree before the call.
Entity Linking and Runtime Control
- Named entity recognition and entity linking (Wu et al. 2020, De Cao et al. 2020, etc.) map mentions to canonical identifiers; RouteBR uses a smaller closed-list problem: the registry defines the unique dispatchable objects, and ambiguity is recorded as UNRESOLVED.
- Runtime guardrails and executable specifications (NeMo Guardrails, AdaptiveGuard, AgentSpec) constrain model-driven transitions; RouteBR, after semantic selection, has code validate the submitted action and its object against the catalog before calling.
Baselines and Benchmark: the comparison systems are B1 Direct (a program with no explicit rules, one call predicts the route) and B2 Direct+Guard (given the full rules, one call predicts the route); evaluation uses the authors' self-built 600-case benchmark (MAIN/FLIP/ENTITY views). Table I compares the properties of the formulations' evaluations, and the authors state that RouteBR combines closed objects, versioned state, typed action contracts, deterministic transition ownership, and pairwise state tests into a single pre-dispatch decision.
How does the paper address this problem?
RouteBR separates the semantic proposal from code-owned execution: the model only submits the main route, and deterministic code decides dispatch or a bounded terminal state after state gating and closed-list object validation.
Overall idea: RouteBR (Route Before Response) places the controller between the customer entry point and downstream response services; the model only contributes typed semantic proposals, and ordinary code owns the final software transition.
Problem Setting and Formalization
- Input I = ⟨x, h, S, E, z, R⟩: request x, bounded history h, versioned service catalog S, closed entity registry E, runtime state z, priority rules R; the output is a dispatch record (a, o) or one of {CLARIFY, DEFER, HANDOFF, REJECT}.
- The trust boundary has three parties: product engineers own the catalog and rule set, the session and service infrastructure own z, and the model only submits semantic proposals; downstream services can only be reached via the controller's dispatch return.
- The catalog contains 5 action families (Table II: consultation, information query, account analysis, support, protected operations), of which 4 are object-sensitive and support may have no object; 8 synthetic predicates and priority rules simulate the boundary.
Proposals and the Main-Route Commitment
- The model outputs q = ⟨a, o, K⟩, where a is the primary action, o ∈ E ∪ {NONE, UNRESOLVED}, and K is at most 3 candidates; the contract requires a = K1, and K2 and K3 are kept only for audit and cannot become a fallback route after policy evaluation.
- The prompt receives the request, history, catalog description, and candidate entities, but not runtime predicates and rules; objects can only be resolved via exact code, name, alias, or unique antecedent, and similarity matching and generated identifiers are prohibited.
- Validation proceeds from syntax to enumerated identifiers to cross-field relations; only one format-only repair is allowed, the repair must not replace semantic evidence or closed identifiers, and a second failure enters the configured non-dispatch terminal state.
Deterministic Execution and Object Validation
- The policy engine takes the first matching rule: b(a, z, R) = rj.decision, where j is the rule with the smallest numeric priority among rules with ri(a, z)=true; the model does not predict b and cannot override it.
- Final transition: T(q, z) returns b when b ≠ ALLOW, returns CLARIFY when b = ALLOW but the object is unresolved, and returns DISPATCH(a, o) when b = ALLOW and the object passes the action-specific closed contract.
- Three constructive invariants: the dispatched action belongs to S; the required object belongs to E and satisfies the contract; no dispatch occurs when the winning rule is not ALLOW. Semantic correctness remains an empirical question.
Implementation and Evaluation Approach
- Algorithm 1 gives the full control path; the reference implementation is dependency-free Python, including typed records, a replay backend, an OpenAI-compatible adapter, and a deterministic policy engine, with 10 unit tests covering normal dispatch, invalid JSON, out-of-catalog objects, the main-route commitment, removal of state/object validation, and adapter behavior.
- Configuration loading is likewise fail-closed: it rejects an empty catalog, rejects DISPATCH as a fallback terminal state, and requires at least one rule with no duplicate identifiers; rules are sorted by numeric priority and stable identifier.
- Evaluation metrics: final-path exact match, macro-F1, action accuracy, false dispatch (denominator is gold non-dispatch cases), false block (denominator is gold ALLOW cases), FLIP pairwise accuracy, object accuracy, valid JSON, call count, tokens, and latency; pairwise system differences use the exact McNemar test.
What experiments did the paper conduct?
Compares RouteBR with two single-call baselines on a 600-case self-built benchmark, plus two mechanism interventions and a six-backend panel; RouteBR is 97.5% on MAIN, with 0 false dispatches among 166 bounded cases.
Experimental Setup
- Backends under test: six hosted backends—DeepSeek V4 Pro, DeepSeek V4 Flash, Qwen3.8 Max, GPT-4o, Qwen3.7 Plus, GPT-5.2; RQ1–RQ3 fix DeepSeek V4 Pro, and RQ4 only swaps the backend.
- Benchmark: 600 privacy-preserving customer service scenarios, reconstructed from confidential request patterns of a real financial institution, jointly reviewed by three engineers; DEV 120 cases, SELECT 160 cases (100 MAIN/40 FLIP/20 ENTITY), CONFIRM 320 cases (200 MAIN/80 FLIP/40 ENTITY); gold boundary is 262 ALLOW, 128 CLARIFY, 75 DEFER, 75 HANDOFF, 60 REJECT.
- Comparison systems: B1 Direct (rule-free program), B2 Direct+Guard (given the same state, rules, catalog, and output contract); mechanism checks A-state (bypass state execution) and A-ground (disable the closed object resolver).
- Metrics and tests: final-path exact match, macro-F1, action accuracy, false dispatch/false block (with applicable denominators), FLIP pairwise accuracy, object accuracy; exact McNemar test, Wilson intervals stored in artifacts.
- Protocol: temperature 0, reasoning mode off, concurrency 1, one format-only repair allowed; the experimental matrix totals 1,960 system–case executions (excluding repair calls), one semantic call per case.
Main Results
According to Table V (CONFIRM, DeepSeek V4 Pro as backend; FD/FB denominators are 166 bounded/114 dispatchable cases, MAIN and FLIP counted together):
Swipe horizontally to read the table
System MAIN path exact match Macro-F1 FLIP pairwise FD FB RouteBR 97.5% 96.3% 92.5% 0/166 1/114 B1 Direct 41.0% 36.2% 10.0% 127/166 2/114 B2 Direct+Guard 95.5% 94.5% 100.0% 1/166 2/114 - The authors state that RouteBR's difference from B1 is significant (p < 0.001) and from B2 is not significant (p = 0.344); B2 leads RouteBR on the FLIP pairwise metric, 40/40 versus 37/40.
- B1's action accuracy is 94.0% but path exact match is only 41.0%; its 118 path errors include 96 false dispatches; the authors therefore argue that action accuracy cannot serve as the acceptance object for pre-dispatch routing.
- Of RouteBR's 5 MAIN errors, 4 confuse account analysis with information query; the 3 FLIP error pairs are also the same semantic confusion, and the code-computed boundary is correct on all 80 members.
Mechanism Checks (RQ2, RQ3)
- A-state (Table VI): after bypassing deterministic state execution, FLIP path exact match drops from 96.2% to 46.2%, 0/40 pairs are correct, and all 40 members that should be bounded are dispatched; the authors state this isolates the effect of the code-owned policy.
- A-ground (Table VI): after disabling the closed object resolver, ENTITY path exact match is 45.0% and object accuracy is 42.5%, and all 22 dispatchable object-sensitive cases are blocked; the authors state that its zero false dispatch comes at the cost of complete loss of availability on that subset.
- ENTITY main results: full RouteBR achieves 100.0% path exact match and 95.0% object accuracy on 40 cases; the 2 object mismatches occur on CLARIFY cases that are bounded anyway.
Backend Portability (RQ4)
- Path scores (Table IV, SELECT-160): the six backends range from 95.6% to 97.5%, within a 1.9 percentage point spread; DeepSeek V4 Pro, V4 Flash, and Qwen3.8 Max are all 97.5%, GPT-4o 96.9%, Qwen3.7 Plus 96.2%, GPT-5.2 95.6%; no backend produces false dispatches.
- Interface and cost: valid JSON 99.4%–100% (V4 Flash has 1 case still invalid after repair, entering the fail-closed fallback), 1.00–1.01 calls per case, median latency 996–2329 ms; GPT-5.2 false block 6.6%, Qwen3.8 Max 0.
- The authors state that the narrow path score distribution indicates the contract is portable, and the final matrix selects V4 Pro as the fixed backend for RQ1–RQ3.
Other Ablations and Analyses
- Among the 1,000 CONFIRM executions in RQ1–RQ3, there are no repairs, fallbacks, or transport errors.
- 23 CONFIRM cases have multiple non-default rule matches, with the gold result determined by the frozen numeric priority.
- The paper does not report per-class error distribution details beyond action accuracy; the 3 FLIP error pairs are all account analysis/information query confusions.
What are some points that can be further explored?
The authors list scope limitations such as synthetic states, single-institution data, and a closed ontology, and plan to extend predicate types, independent review batches, and shadow deployment evaluation.
Limitations and Future Directions Noted by the Authors
- Annotation was jointly reviewed by three engineers with no independent repeated annotation, and inter-annotator agreement was not computed (Section IV-B).
- The controlled distribution targets contract boundaries and mixed service language; estimating the frequency of problems in production traffic requires a separately sampled operational dataset (Section IV-B).
- Transfer is limited by the closed ontology, equality predicates, a single submission object, and hosted backends; the metrics focus on routing correctness and permissibility at the dispatch boundary, while end-to-end reply quality and online operational outcomes belong to the next evaluation layer (Section V-C).
- Future evaluation should extend to scope, temporal, and cross-field predicates and composite requests, test independently reviewed institutional batches, and evaluate the controller via a privacy-preserving shadow deployment (Section V-C).
- Evaluation on other languages, service catalogs, and subsequent hosted checkpoints is left for future work (Section IV-D).
- Hosted checkpoints may change behind stable aliases; the identifiers reported in the request and response define the evaluated service profile and its reproduction scope (Section IV-B).
Experimental Coverage
- The backends under test are 6 hosted models; RQ1–RQ3 fix DeepSeek V4 Pro, and RQ4 swaps backends on SELECT-160.
- The 600-case benchmark comes from reconstructed patterns of one financial institution; runtime states and policies are synthetic, and 40 ETF identifiers are public; DEV/SELECT/CONFIRM are disjoint.
- The comparison systems are two single-call designs, B1 and B2; the mechanism checks are A-state and A-ground; all systems terminate at the dispatch boundary record, and real institutional services are not within the experimental execution.
- Pairwise comparisons use the exact McNemar test, and final-path and FLIP pairwise accuracy record Wilson intervals; 1,960 prediction rows are paired with original receipts.
- The paper does not report per-case query cost amounts; latency and tokens only describe the hosted service's operating conditions at the time of access.
Summarize the main content of the paper
RouteBR lets the model propose and code adjudicate: on a self-built 600-case financial customer service routing benchmark, MAIN path exact match is 97.5%, and among 166 bounded cases there are 0 false dispatches.
A paper on the dispatch boundary of LLM customer service software: a financial institution's customer service entry point must select a downstream service before replying, but the service matching the request is not necessarily permitted by the current state and policies, and the entity may not map to a registered identifier.
- Problem: classifiers and LLM routers only give a label or destination and lack permission and registration validation before dispatch; false dispatch sends out a request that should be stopped, and false block stops a request that should be dispatched.
- Method: in RouteBR, one model call proposes the primary service action and registered object, deterministic code performs state gating by versioned rules and validates the object against a closed list, then outputs a dispatch or CLARIFY/DEFER/HANDOFF/REJECT; lower-ranked candidates cannot replace a blocked main route, and decisions can be replayed from records.
- Benchmark: 600 privacy-preserving scenarios, reconstructed from confidential request patterns of a real financial institution, jointly reviewed by three engineers, split into MAIN/FLIP/ENTITY views and DEV/SELECT/CONFIRM partitions.
- Main results: on CONFIRM MAIN (200 cases, DeepSeek V4 Pro backend), RouteBR's final-path exact match is 97.5%, versus 95.5% for B2 with the same information (p = 0.344, not significant); rule-free B1 has 94.0% action accuracy but only 41.0% path accuracy; among 166 MAIN+FLIP bounded cases, RouteBR has 0 false dispatches.
- Mechanism and portability: after removing state execution, all 40 FLIP members that should be bounded are dispatched; after removing object validation, all 22 dispatchable object-sensitive cases are blocked; the six backends' path scores range from 95.6% to 97.5%.
- Authors' conclusion: the results support separating model proposals from code-owned, replayable execution, with the complete executable route rather than an isolated label as the acceptance object; the authors state that evaluation of end-to-end reply quality, cross-institution data, and more complex predicates is left for future work.