Tell a Bot what it holds, not only hand it the tools - #143
Merged
Conversation
A tool array tells a model a tool exists. It does not tell it the tool is the right way to reach that system, and it competes with COMPUTER_GUIDANCE — a page of emphatic prose about the browser that every Bot receives whether or not it has a single connector, and that mentions connectors nowhere. "Never claim you cannot browse" is in there. Nothing is. The browser prose won. A Bot holding four Google Drive tools browsed to drive.google.com, met a sign-in page its container can never satisfy, and asked its person to sign in to a vendor that person had already connected. The tools were loaded the whole time. So the grants are now said out loud, in the Bot's own instructions, and before the browser prose rather than after it. The text is generated from the grants rather than written anywhere: switching a connector on, or granting one more of its tools, changes what the Bot is told on its next run with nothing to keep in step. A Bot holding nothing is told nothing. Both paths, because they are built by different functions and the remote one is where it failed: a framework Bot gets COMPUTER_GUIDANCE as its entire prompt, so it had the least reason of any to reach for a tool. Verified against the document rather than the answer. Read a PRD's text through the API first, took a line out of it — "Kai reached 83% company-wide" against weekly active users — then asked in the chat. The Bot answered 83% and named the metric, using search_files, search_files, read_file_content, and never touching the browser. Two minutes earlier, on the same trail, a Bot without those grants met the sign-in wall.
davidmckayv
requested review from
MikeRyanDev,
guidovizoso and
tylerslaton
as code owners
August 22, 2026 03:25
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.
Fixes the behaviour behind #141.
The problem
You connect Google Drive. You grant its tools to a Bot. You ask that Bot what is in a document. It opens
drive.google.comin its own browser, meets Google's sign-in page, and asks you to sign in — to a vendor you connected ten minutes earlier.The tools were loaded the whole time.
Why
A tool array tells a model a tool exists. It does not tell it the tool is the right way to reach that system. And it is competing with
COMPUTER_GUIDANCE: a page of emphatic prose about the browser, given to every Bot whether or not it holds a single connector, containing lines likeand mentioning connectors nowhere.
Read on its own, that text answers "how do I browse" and never "should I". So the browser wins, because it is the most capable tool and nothing says otherwise.
The remote path had it worst: a framework Bot gets
COMPUTER_GUIDANCEas its entire prompt, so it had the least reason of anything to reach for a granted tool. That is the Bot that browsed to Drive.The fix
Say the grants out loud, in the Bot's instructions, before the browser prose:
Generated from the grants, not written down. An administrator switching a connector on, or granting one more of its tools, changes what the Bot is told on its next run with nothing to remember and nothing to keep in step. A Bot holding nothing is told nothing, so a deployment with no connectors is not lectured about connectors.
Applied to both paths, because they are built by different functions and a fix to one is the bug again in the other.
Order matters as much as presence, and there is a test for it: the grants land before
COMPUTER_GUIDANCE, because a Bot that read the browser prose last reached for the browser.Proof, checked against the document rather than the answer
A plausible answer is not evidence, so the ground truth came out of the file first, programmatically:
Then the same question in the chat:
Exact match, including the metric it belongs to.
The audit trail shows the contrast inside one three-minute window:
computer_navigate→computer.help_requested→ sign-in wallsearch_files,search_files,read_file_content— no navigate at allAll three tool calls
reachedAsthe asking user.Before this change, the second row looked like the first.
bun run testbun run typecheckbun run format:checkbunx biome lint .mainTests
Four. That the guidance names the system and its tools; that it carries the do-not-browse instruction, which is the line that does the work; that a Bot holding nothing gets nothing; and that the grants land before the browser prose.
Not in this PR
knowledge, which holds no Drive grants, because routing reads role descriptions and not what a Bot can actually reach. A question about Drive should prefer a Bot that can reach Drive. Its own change, and closer to K3 — search is a tool call: shipped, one wiring gap left #119's territory.