Repository navigation
Give agents only their granted built-in tools and no account connectors - #266
Merged
Merged
Conversation
Red first. A permission pattern such as Bash(git status) in the SDK tools list makes the CLI drop that tool, so the presence layer must carry base names, without mcp entries, de-duplicated. The approval layer keeps the grant verbatim. The old pin that duplicates reached the presence layer verbatim is rewritten as part of this contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A permission pattern such as Bash(git status) in the presence list made the bundled CLI drop that tool. The presence list is now derived from the grant: base names before the first parenthesis, no mcp entries, no empty names, de-duplicated in first-seen order. The approval list keeps the grant verbatim. The same derivation lives in the private lineage of this module; the two change together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base-name derivation is its own contract, so its tests move out of the tool-presence module unchanged, which brings that module back under the 500-line cap. The helper's docstring is shortened to the contract and the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t fix Two raises to exactly the measured size, each with its reason and the alternatives rejected: 18 lines for the derivation helper in src/bonfire/dispatch and 108 lines for its contract tests in tests/unit. Both packages were frozen at their measurement with no headroom, so no change to either could land without one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Fixed entry moved the CHANGELOG lines the persona-name allowlist pins by eleven. The anchors move, the expected text does not, with a breadcrumb as earlier changelog additions left. The tests/unit raise is re-measured to include the breadcrumb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reason text only: what the 18 dispatch lines are, the docstring's real length, the rejected compressed variant, and that all four contract tests fail on main. Ceilings unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red first. A logged-in CLI attaches the user's claude.ai connectors, which no tool grant declares; the backend must switch them off and add no MCP servers or strict MCP config of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A logged-in CLI attaches the user's claude.ai account connectors, which no tool grant declares; a live check saw Claude Docs and Google Drive tools reach a read-only agent. The agent environment now sets ENABLE_CLAUDEAI_MCP_SERVERS=false. No MCP server or strict MCP config is set, so a user's own project MCP servers still load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Anchors move by three more, expected text unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dispatch 2883 to 2905 and tests/unit 74187 to 74319, both read from cf-file-budget on the final tree, with the added lines itemised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
tools=) is now derived from the tool grant: the base built-in name before the first((Bash(git status)→Bash),mcp__*entries and empty names left out, de-duplicated in first-seen order. The approval list (allowed_tools=) keeps the grant verbatim.ENABLE_CLAUDEAI_MCP_SERVERS=false. No MCP server or strict MCP config is set, so a user's own project MCP servers still load._builtin_toolsis mirrored in the private lineage at the same path; each copy names the other.Why (manual checks against the bundled CLI)
tools=['Read','Bash(git status)']exposed only Read: a permission pattern in the presence list silently drops the tool. The shippedDefaultToolPolicyuses plain names, so shipped roles kept their tools. A customToolPolicyreturning a pattern, or anmcp__name, lost it.[Bash, Edit, Glob, Grep, Read, Write]/[Grep, Read]/[Glob, Grep, Read]), 0 connectors.Contract change (operator-approved)
The old pin
test_duplicate_tool_names_propagate_verbatim(duplicates reachtools=verbatim) contradicts the shared derivation:tools=is now de-duplicated andallowed_toolsstays verbatim. It was replaced, not deleted, by a stronger test with a breadcrumb, written by the red cell. The CHANGELOG states the behaviour change.Tests (red observed before each implementation, judged with
gates/assert-red.mjs)909c269). Connectors: 1/1 driving test failed (930f6bc).tests/unit/test_sdk_backend_presence_base_names.py, its own contract module. Adding it to the presence module would have crossed the 500-line cap.tests/unit/test_no_persona_names_in_public_docs.py: the CHANGELOG line anchors move by 14 (expected text unchanged, breadcrumb), as every earlier CHANGELOG addition did.Package budget raises (law-ratchet lens: SIGNED OFF)
Both packages were frozen at their measurement with zero headroom. Both raises go to exactly the
cf-file-budgetreading.src/bonfire/dispatch_builtin_tools(1 mirror comment, 15-line function, 2 blank lines; the import joined an existing line) + 4 for the connector switch (comment, constant, blank line,env=kwarg)tests/unitWhy structure could not absorb them: the docstring was cut from 17 to 6 lines first, and the tests were split out to stay under the file cap. Every remaining line is a contract line or a required breadcrumb. Rejected alternatives: a purpose entry or an unbudgeted tree (both dodge the ratchet), and
tests/integration(wrong home). Law-ratchet sign-off on the final tree: dispatch YES, tests/unit YES. Lens minors (also OWED below): about 7 test lines could be tightened, and a 2-statementdict.fromkeysbody was weighed and rejected for readability (stated in the reason).Gate
-m "not live"): 5867 passed, 0 failed (main: 5862 passed, 0 failed).cf-gateagainst detachedorigin/main: no new red, gate text identical. The first run had caughtcf-file-budgetred, which led to the split and the raises above.FILE_BUDGET_NEWonCHANGELOG.md, a known instrument false red on a file that exists on main.Review
Five-lens panel. Contract+correctness: minors only; no shipped role loses a tool; the security hook matcher
Bash|Write|Editstill fires. Law-ratchet: signed off as above. A green cell that editedfile-budget.jsonwith hand-estimated numbers (outside its fence) was reverted; the numbers above are gauge readings.OWED
test_sdk_backend_tool_presence.pystill describe the old verbatim contract; about 7 test lines could be tightened.DispatchOptions.max_budget_usddefaults to0.0, which the current CLI rejects (--max-budget-usd must be a positive number).test_sdk_backend_tool_presence.pydocstrings (not added here).🤖 Generated with Claude Code