Repository navigation
Conversation
simple_agent posts each function call to <tool base URL>/<function name> without checking the name against the request's tools. The model chooses the URL path, so an undeclared name reaches any route of the Resources Server with the episode's cookie: verify or close_session at the root, or ../verify past a grant whose base URL has a prefix. - Refuse a function call whose name is not one of the request's function tools, including the function tools of a namespace tool. The model gets an "Unknown tool" error as the tool output, and no HTTP call is made. - Record the refused call as failed, with error_type unknown_tool. - Declare the called tools in the nine tests whose requests did not. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Contributor
Author
|
/ok to test cfd475e |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
simple_agentsends each function call that the model emits to<tool base URL>/<function name>. Until now it did not check the name against the tools that the request declares. Now it does:{"error": "Unknown tool '<name>'"}, and no HTTP call is made. Invalid JSON arguments are already handled this way.functiontools, including the function tools inside anamespacetool.failedwitherror_type: "unknown_tool".The check covers both paths: the direct HTTP tool grant of an agent session, and the
resources_serverconfiguration of/run.Why
The function name is the last part of the tool URL, so the model chooses the URL path. A name that the request does not declare can reach any route of the Resources Server, with the episode's session cookie:
/verify,/seed_sessionand/close_session. A function call namedverifyorclose_sessionreaches those routes.../verifyresolves outside the prefix, because the URL path is normalized.This came up in the review of #5202 (BIRD-Interact). There, an a-Interact agent could reach the c-Interact submit route with a function named
../submitand have its SQL graded without paying BIRD-COIN. #5202 adds mode checks for BIRD. This PR closes the general gap for every environment that runs onsimple_agent.There is no issue: the gap was found in the #5202 review, and this description records it.
Compatibility
Behavior changes only when the model calls a tool that the request does not declare. I checked the Resources Servers with catch-all tool routes that run on
simple_agent. In each one, the change only affects the error text that the model sees, and no score depends on it directly:math_advanced_calculationscitation_ifmax_steps: 1, and any function call fails the first gate.ns_tools{"error": "Unknown tool: X"}indirect_prompt_injectionverifyscores thefunction_callitems, not their outputs, so the call still counts. The tool no longer runs, so later turns may differ.nullable_tool_args{"status": "ok"}for any name.verifygrades only the arguments of the first call.workplace_assistantverifyskips unknown names.partner_if(mock tools)errorkey. This output is.finance_agent_v2,finance_sec_search,conversational_tool_use_simulation,enterpriseops_gymandrna_design.labbench2_vlm_agentandgdp_pdf_agentsubclassSimpleAgentand get the check too.example.jsonlfiles and found none that run onsimple_agent.Validation
pytest responses_api_agents/simple_agent/tests/test_app.pyverify,../verify,lookup/../../close_session, and a/runwithout a grant) fail onmain. The namespace test passes on both.pytest responses_api_agents/labbench2_vlm_agent/tests responses_api_agents/gdp_pdf_agent/tests(the two subclasses)pytest tests/unit_tests -n 8, with the extras that CI installsmainon this workstation: three sandbox file-mode tests, four Harbor run-summary tests, and a benchmark-listing test whose configs do not resolve because the host name resolves to127.0.1.1.pre-commit runon the changed filesRollout evidence
Not yet: this PR is a draft. Before review, I will run smoke rollouts on
example_single_tool_calland two of the servers above, and compare rewards withmain.🤖 Generated with Claude Code