Skip to content

[High] Skill install can broaden allowed-tools beyond the human-approved plan #8

Open

Description

@adilei

Severity

High — trust-boundary defect: privilege escalation past the human-in-the-loop review gate.

Location

electron/skillbuilder/builder.ts:181:

allowedTools: submission.allowedTools.length ? submission.allowedTools : plan.allowedTools,

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.md allowed-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:

const finalAllowed = submission.allowedTools.filter((t) => plan.allowedTools.includes(t));
allowedTools: finalAllowed.length ? finalAllowed : plan.allowedTools,

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).

Activity

  1. wuwangzhang1216 commented on Aug 4, 2026

    @wuwangzhang1216

    I'd like to take this one.

    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
    • pattern subsumption → ["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 *), 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.

  2. added a commit that references this issue on Aug 4, 2026
    a8067b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions