Skip to content

feat(agents): deny six unused tools for Code, Fix and Refactor - #777

Merged
dean0x merged 9 commits into
mainfrom
feat/775-code-fix-refactor-tool-allow-list
Nov 10, 2026
Merged

dean0x merged 9 commits into
mainfrom
feat/775-code-fix-refactor-tool-allow-list

Conversation

@dean0x

@dean0x dean0x commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Code, Fix and Refactor start with six tools that no Code path uses. Each start uses tokens for these tools. This change adds the six tools to the deny-list of these agents.

Changes

  • Code, Fix and Refactor deny six more tools: Monitor, TaskStop, Workflow, Artifact, ListAgents and ReportFindings.
  • The form stays a deny-list (disallowedTools). The agents keep Skill, ToolSearch, web tools and every user MCP tool.
  • No path of these agents uses the six tools:
    • Workflow starts agents, and ListAgents finds agents to message. Code, Fix and Refactor start and stop no other agent, and they message no agent.
    • TaskStop stops a background run, and Monitor waits on one. These agents run commands in the foreground.
    • Artifact publishes a page, and ReportFindings reports review findings. These agents do neither.
  • The headless start token count falls by 1,189 per spawn (4.8 percent). See Testing.
  • Three size ceilings rise by 85 bytes each. The rise covers frontmatter tool-list bytes only. No body text was cut.
    • code-body-max: 9,657 to 9,742
    • fix-body-max: 7,266 to 7,351
    • refactor-body-max: 5,952 to 6,037
  • Two new ceilings hold the Code builds for machines with TDD off. Before, no guard measured them.
    • code-body-tdd-off-max: none to 9,750
    • code-body-curation-tdd-off-max: none to 9,398
  • New tests check the kept tools. Other tests check that no agent body directs a denied tool.
  • The changelog notes the six tools. The agent design doc, the platform doc and a source comment name Fix and Refactor as deny-list agents.

Why a Deny-List

The issue asks for an allow-list. This change does not use one. An allow-list removes the user's MCP and web tools. The scan step and the compliance load need those tools.

The tools: key names MCP tools per server (mcp__<server>). No entry keeps all user MCP tools.

The issue measured 26.6 percent with a six-tool allow-list. That list is not used, for the reason above.

Breaking Changes

None expected.

Testing

Validation: the full build and suite pass at 5dba1e40. Result: 408 files, 19,215 tests passed, 8 skipped.

Headless measure

  • Arm A (main): 24,709 start tokens.
  • Arm B (this branch's list): 23,520 start tokens.
  • Saving: 1,189 tokens (4.8 percent).
  • Setup: Claude Code 2.1.319, claude -p, no MCP server.

An interactive host saves more, because the Artifact tool reaches subagents there.

Shipped-file check

One headless spawn each of the built Code agent from main and from this branch. Only the name line of each file was changed.

  • Main build: 24,592 start tokens.
  • Branch build (5dba1e40): 23,403 start tokens.
  • Saving: 1,189 tokens (4.8 percent), the same as the headless measure.
  • Setup: Claude Code 2.1.322, claude -p, no MCP server. Each spawn replied "OK" through its one hand-back call and made no other tool call.
  • The check cost 166,382 ce, over the 0.1M check budget. The maintainer accepted it. The start token result matches the earlier measure.

Known Limits

  • The saving is measured headless only.
  • A new built-in tool reaches these agents until a developer adds it to the list.
  • A headless Bash call past its timeout is killed. This is recorded. The wait text is a follow-up.
  • Research, Harden, Polish and other worker agents do not change in this PR.

Related Issues

Closes #775

Code, Fix and Refactor now deny Monitor, TaskStop, Workflow, Artifact,
ListAgents and ReportFindings on top of the shared deny list, so they
start and stop no other agent. Research keeps the shared list only.
The frontmatter stays a deny list with no tools key.

The guard gains a keep set (DENY_AGENT_KEEP) that no deny-list agent
outside Harden and Polish may deny, a pin over all three Code-family
slugs, row probes for each extra name, and body probes that run every
extra name through the real collectors. The body-size ceilings of the
three agents move to the measured size: the added bytes are frontmatter
tool-list bytes, and no body text was cut.

Refs #775
Record the Code-family extra deny list in the agent design guide. Mark
the disallowedTools platform assumption as verified live, add Fix and
Refactor to its drift text, and record the headless Bash timeout result.
Update the tracker-servers comment to list the four deny-list agents.

Refs #775
Name Code, Fix, Refactor and Research in the shared deny-list comment. Add the headless probe date to the date column of the Bash timeout row.
The ceiling guard measured the default and curation-off builds of each
Code-family variant only. The tdd-off and curation-tdd-off builds of Code
had no guard, and the tdd-off build was already 8 bytes over the Code
ceiling. Each build now has its own ceiling at its measured size, and an
absent build fails the guard instead of skipping it. Both ceilings are
registered in the numeric floor manifest with old value, new value and
reason.

The code-body-max description said a later addition funds itself with a
cut, but the same entry records a raise that no cut paid for. The text now
matches the either-way rule.
The text said Code, Fix and Refactor deny six tools so they start and
stop no other agent. That is false for Monitor, Artifact and
ReportFindings. The text now says no path of these agents uses the six
tools: they run commands in the foreground, start and message no agent,
publish no page and report no review findings.

Task: resolve-batch-b
The deny-extra comment gave a false reason for all six denied names. It
now gives one true reason for each pair of names. The keep-set comment
said the set leaves out WebFetch and WebSearch, but the set lists both.
The comment now matches the set. Comment text only.

Task: resolve-batch-b
The test-harness goldens and budgets KB said ceilings only fall and a
ceiling rises only on maintainer authorisation. The repo rule is that a
floor or ceiling may move either way, and its description and the PR
give the old value, the new value and the reason. The KB now states that
rule. The Recorded Exceptions rows stay as history. The file is shorter
than before.

Task: resolve-batch-b
@dean0x

dean0x commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Review and test evidence (head 5dba1e4)

Code review, cycle 1 (at cf08334)

Result: APPROVED. Gate level lean (security, testing, reliability). Blocking: 0. Should-Fix: 1 MEDIUM. Pre-existing: 0. Suggestions: 5.

The change removes tool access from the Code, Fix and Refactor agents. It adds no tool access.

Resolve (cycle 1)

9 issues: 5 fixed, 4 deferred, 0 false positive, 0 duplicate. The 9 issues are the review findings plus two text corrections.

# Sev Fix Commit
1 MEDIUM The tdd-off and curation-tdd-off Code builds now have their own ceilings (9,750 and 9,398 bytes, the measured sizes) and a known-bad probe. Before, no guard measured them. e7af24c
2 LOW The code-body-max description no longer says that each addition needs a cut. e7af24c
3 LOW The DENY_AGENT_KEEP comment now matches its set. b1be0fc
4 LOW Each of the six denied tools now has a true reason in the changelog, the agent design doc and the fixture comment. 789814f, b1be0fc
5 LOW The test-harness knowledge base now states the either-way rule for floors and ceilings. 5dba1e4

Deferred (LOW, not in this PR): a check of the Code-family frontmatter in the feature-off builds; a drift symptom for the ToolSearch row; a follow-up number for the headless-timeout row; a name-shape check for the tool vocabulary.

New ceilings (old value, new value, reason):

  • code-body-tdd-off-max: none to 9,750. The tdd-off Code build had no guard.
  • code-body-curation-tdd-off-max: none to 9,398. The curation-tdd-off Code build had no guard.

Evidence

  • Full suite at 5dba1e4: 408 files, 19,215 passed, 8 skipped, exit 0 (Node 24). Build and typecheck pass. Lint is not configured.
  • GitHub CI: passing on 5dba1e4.
  • Shipped-file check (Claude Code 2.1.322, claude -p, no MCP server): one headless spawn each of the built Code agent from main and from 5dba1e40, name line changed only. Start tokens: main 24,592, branch 23,403. Saving: 1,189 tokens (4.8 percent). The check cost 166,382 ce, over the 0.1M check budget. The maintainer accepted it. The start token result matches the earlier measure.
  • Test plan at 5dba1e4: 8/10 verified by CI or local runs (VERIFIED-CI 5, ATTESTED-LOCAL 3). Manual checks against the PR body: TP-9 PASS, TP-10 PASS.

Merge readiness: waits for an approving review and the PR body update. CI and threads are clear.

@dean0x
dean0x marked this pull request as ready for review November 10, 2026 11:32
@dean0x
dean0x merged commit 5d5820e into main Nov 10, 2026
3 checks passed
@dean0x
dean0x deleted the feat/775-code-fix-refactor-tool-allow-list branch November 10, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code, Fix and Refactor: an explicit tool allow-list (26.6% smaller start)

1 participant