Banking AI agent tool selection testing checks whether an AI agent chooses an authorised tool that fits a banking request and the current workflow state, and avoids calling tools when conditions do not permit an action. It evaluates the selection decision separately from argument correctness, tool execution and the final response, using controlled scenarios with expected, permitted or prohibited calls.
How banking AI agent tool selection testing works
An agent selects from tools exposed to it, such as an account-balance lookup, payment-status query or transfer initiation function. Selection depends on the request, conversation context, available account data, tool descriptions and policy controls. A test therefore needs a defined tool catalogue and a known starting state. Record versions of the model, prompt, tool descriptions and policy configuration so a failure can be reproduced after a change.
For each scenario, specify the user's intent, relevant context, tools that may be called, tools that must not be called and any required approval or authentication state. Assert the selected tool and call count. Where several tools could safely fulfil a request, define an acceptable set instead of requiring one exact choice. Keep argument validation as a separate assertion: a correct tool with an invalid account identifier still fails the overall test.
Use mocks, service virtualisation or a controlled test environment for tool execution. A selection test should not create a real payment or change a customer account. Check the tool-call trace and policy decision, then verify that a prohibited call was blocked before it could reach a banking service.
Design scenarios around intent and authority
Build cases from ordinary requests and conditions that change what the agent is permitted to do. Include read-only enquiries, requests to initiate or amend a transaction, missing details, expired authentication, insufficient permissions, transaction limits and requests requiring a human approval step. Include negative cases where the agent should ask a clarifying question, hand over to a person or decline to act without selecting a transaction tool.
Test the effect of misleading content in retrieved documents or tool responses. For example, a payment reference that tells the agent to ignore its instructions must not cause it to select an unrelated or privileged tool. Check both the attempted selection and the enforcement layer that blocks an unauthorised call. Tool descriptions and external content can influence model behaviour, so changes to either deserve regression coverage.
Worked example: scheduled transfer status
Scenario: an authenticated customer asks, "What is the status of my scheduled transfer to the electricity provider?" The test fixture contains one matching scheduled transfer and exposes get_scheduled_transfer_status and initiate_transfer.
Expected checks:
- The agent selects
get_scheduled_transfer_statuswith the fixture's transfer reference. - It makes one status lookup and does not select
initiate_transfer. - The returned status is reported accurately, without claiming that a new payment was made.
Add variations where there are two matching transfers, the customer is not authenticated, or the status service returns an error. The agent should request enough information to identify the transfer, follow the access policy, or report that it cannot retrieve the status. It should not guess a reference or switch to a payment tool to satisfy the request.
Interpret failures and verify outcomes
Classify failures by stage: wrong tool selected, prohibited tool attempted, correct tool with invalid arguments, policy block, service error, or inaccurate final response. This separation helps identify whether the cause lies in the model or prompt, tool metadata, context assembly, authorisation checks or the downstream service.
Agent outputs can vary across runs. For repeatable evaluation, keep the fixture and configuration fixed, capture every proposed tool call, and assess whether each call falls within the scenario's allowed outcome. Repeated runs can expose unstable selections; they do not replace assertions for unsafe calls. Verify the full trace, including rejected calls and approval decisions, rather than relying on the final conversational answer alone.
A passing selection test establishes that the agent chose an acceptable action under the tested conditions. It does not establish that the banking service processed the action correctly or that the end-to-end workflow completed. Those outcomes need their own assertions in integration or end-to-end tests.
Frequently asked questions
What should a team review when changing an AI model or prompt?
Run the tool-selection cases linked to the changed behaviour, then include regression cases for high-impact banking actions and prohibited calls. Compare the recorded tool-call traces and policy outcomes with the approved expectations before releasing the change.
What evidence should a tool-selection test retain?
Retain the scenario identifier, fixture state, model and prompt versions, tool catalogue version, proposed tool call, policy decision and test result. Redact credentials and customer data, and keep enough context to reproduce the decision safely.
How should tests handle a request with more than one safe interpretation?
Define the acceptable next actions for that scenario, such as asking a clarifying question or selecting one of several approved read-only tools. Fail the test if the agent commits to a financial action before resolving the ambiguity.
