You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[High] Skill install can broaden allowed-tools beyond the human-approved plan #8
The comment just above (lines 175–177) asserts "allowed-tools may be tightened by the agent to the final steps, but never emptied below what the plan declared" — but nothing enforces that invariant.
Mechanism
The human reviews and approves a plan with a specific allowedTools set. The builder's create turn is an LLM call returning submission.allowedTools. When non-empty, that value is written verbatim into the installed SKILL.mdallowed-tools frontmatter — with no check that it is a subset of plan.allowedTools. The model can therefore add tools the reviewer never approved.
Impact
An installed skill can be granted capabilities (e.g. shell/network tools) outside what the human approved, defeating the purpose of the plan-review gate.
Suggested fix
Enforce the subset invariant the comment already claims:
Allow tightening/removal; reject additions; log any dropped tools.
Regression test to add (npm test)
Unit test the create/merge logic with submission.allowedTools containing a tool not in plan.allowedTools; assert the final allowed-tools ⊆ plan.allowedTools. (The skillbuilder is currently not unit-tested at all.) Optionally add one adversarial evals/skillbuilder scenario that tries to broaden tools — but the deterministic unit test is the real guard, since the current skillbuilder eval scores only build() (the plan), never create() (the install turn where this bug lives).
One thing worth raising first: the suggested fix filters by plan.allowedTools.includes(t), but allowed-tools entries are patterns rather than fixed strings — and the comment right above that line, plus the builder instructions, deliberately let the agent tighten the grant to the steps it actually emitted. Set-membership rejects every one of those narrowings and falls back to the broader approved pattern.
With approved ["Bash(gh *)"] and submitted ["Bash(gh pr list)", "Bash(rm -rf /)"]:
current main → ["Bash(gh pr list)", "Bash(rm -rf /)"] — the escalation you filed
set-membership → ["Bash(gh *)"] — closes the escalation, but the valid narrowing is discarded and the installed grant ends up wider than the agent asked for
So I'd suggest deciding subsumption instead — does the submitted pattern grant anything the approved one does not — keeping narrowing and refusing anything not provably covered (Bash(gh pr list) ⊆ Bash(gh *), but Bash(*) ⊄ Bash(gh *)).
Happy to fall back to plain set-membership if you'd rather keep the change minimal. PR shortly, with the merge logic as a pure module so it's unit-testable on its own.
Activity
wuwangzhang1216 commentedon Aug 4, 2026
I'd like to take this one.
One thing worth raising first: the suggested fix filters by
plan.allowedTools.includes(t), butallowed-toolsentries are patterns rather than fixed strings — and the comment right above that line, plus the builder instructions, deliberately let the agent tighten the grant to the steps it actually emitted. Set-membership rejects every one of those narrowings and falls back to the broader approved pattern.With approved
["Bash(gh *)"]and submitted["Bash(gh pr list)", "Bash(rm -rf /)"]:main→["Bash(gh pr list)", "Bash(rm -rf /)"]— the escalation you filed["Bash(gh *)"]— closes the escalation, but the valid narrowing is discarded and the installed grant ends up wider than the agent asked for["Bash(gh pr list)"], dropping["Bash(rm -rf /)"]So I'd suggest deciding subsumption instead — does the submitted pattern grant anything the approved one does not — keeping narrowing and refusing anything not provably covered (
Bash(gh pr list)⊆Bash(gh *), butBash(*)⊄Bash(gh *)).Happy to fall back to plain set-membership if you'd rather keep the change minimal. PR shortly, with the merge logic as a pure module so it's unit-testable on its own.
Constrain built-skill allowed-tools to the approved plan