Skip to content

fix(#1292): narrow the broad allowed-tools grants the portal didn't flag — qa gh api, clean rm/find, setup curl/sed - #1323

Merged
admarble merged 4 commits into
mainfrom
feature/1292-fix-skills-narrow-the-broad-allowed-tools-grants-t
Oct 5, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1292-fix-skills-narrow-the-broad-allowed-tools-grants-t

Conversation

@admarble

@admarble admarble commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Removed or narrowed 7 broad allowed-tools entries in qa, clean and setup. I kept jq in setup and test, each with a reason. The same frontmatter is in .claude/skills, templates/skills and plugin/skills (the plugin copy was regenerated with check-skill-sync.ts --fix).
  • Extended the fix(skills): narrow broad allowed-tools grants — bare Bash, Bash(*), and runner wildcards hold the directory listing for review #1287 gate test (src/lib/__tests__/skill-allowed-tools-gate.test.ts). It now rejects any wildcard entry for gh api, rm, mv, find, sed and cp, unless BROAD_ALLOWLIST names the entry with a reason. That includes flag-prefixed forms such as Bash(rm -rf:*) and Bash(gh api -X:*). The allowlist holds the 5 narrowed clean/setup entries, each with its reason. New cases check that Bash(gh api:*), Bash(rm:*), Bash(curl:*), Bash(sed:*) and four prefix variants are rejected, and that wildcard-free commands are kept.
  • Runner fix after QA (cb3ffdd1): QA found that the first version matched only the exact <tool> * form, so Bash(rm -rf:*) and Bash(gh api -X:*) passed the gate while being broader than the removed entries. The rule is now a prefix match with a reviewed allowlist. The allowlisted sed -i.bak * .claude/memory/constitution.md is narrower than sed:* but not exact: * can also match extra file arguments, and its reason says so.
  • Added a CHANGELOG entry under [Unreleased] / Fixed.

AC-1: one row per entry

Skill Entry Disposition Commands that now ask for permission (interactive use only)
qa Bash(gh api:*) Removed. The annotations call is gh api "$url" with a URL built at runtime, so no pattern can cover it. Any endpoint pattern ending in * would also match an appended -X DELETE. gh api …/check-runs and gh api "$url", which run only when every CI check fails (SKILL.md:973,979); gh api 'repos/{owner}/{repo}/issues/comments?per_page=100' --paginate (:2260)
clean Bash(mv:*) Narrowed to Bash(mv * docs/archive/*) and Bash(mv * scripts/archive/*). The * also matches spaces, so a move with several sources still has to land in an archive tree. Any mv whose target is outside the two archive trees
clean Bash(rm:*) Removed. The body never runs rm. Deleting .DS_Store files and empty folders is described in prose only. Those deletions
clean Bash(find:*) Removed. The body never runs find; it scans with Glob. Any find, including -delete / -exec
setup Bash(sed:*) Narrowed to Bash(sed -i.bak * .claude/memory/constitution.md), the only in-place edit (:335) The read-only sed calls inside $(…) pipelines (:78,124,130,133,148). Whether those prompt was not checked, because there was no interactive session.
setup Bash(cp:*) Narrowed to Bash(cp * .claude/memory/constitution.md) and Bash(cp -R * .claude/skills/*) (:328,363) Any other cp
setup Bash(cat:*) Narrowed to Bash(cat package.json) (:119,249) Any other cat
setup Bash(jq:*) Kept. jq only reads and filters JSON; it cannot run commands. none
test Bash(jq:*) Kept, for the same reason none
setup Bash(curl:*) Already removed by PR #1291. It stays in the new literal check as a regression guard. —

AC verification

AC Status Evidence
AC-1 ✅ The table above, plus the frontmatter diff in all three skill folders
AC-2 ✅ FILE_WRITE_TOOLS and BROAD_ALLOWLIST added to the gate, plus the rejects %s (#1292) case. Mutation-verified (below).

Mutation-verified: AC-2 — re-added Bash(rm:*) to .claude/skills/clean/SKILL.md; src/lib/__tests__/skill-allowed-tools-gate.test.ts > skill allowed-tools grant no broad shell access (#1287) > .claude/skills — no bare Bash, Bash(*), tool or runner wildcard, or placeholder failed with clean/SKILL.md: Bash(rm:*) — file-writing or API wildcard not in BROAD_ALLOWLIST (#1292); restored, and all 10 cases pass.

I ran this marker through parseMutationMarkers and it parses with every field intact.

Mutation-verified: AC-2 — added Bash(rm -rf:*) to .claude/skills/clean/SKILL.md (prefix variant, runner fix cb3ffdd1); src/lib/__tests__/skill-allowed-tools-gate.test.ts > skill allowed-tools grant no broad shell access (#1287) > .claude/skills — no bare Bash, Bash(*), tool or runner wildcard, or placeholder failed with clean/SKILL.md: Bash(rm -rf:*) — file-writing or API wildcard not in BROAD_ALLOWLIST (#1292), 1 failed / 14 passed; restored.

Checks

Check Result
npm run build ✅
npm run lint ✅
npm run lint:skill-sync / lint:skill-calls ✅ 48 files in sync / no violations
Gate test ✅ 15/15 after cb3ffdd1 (10/10 before; it was red on exactly the 6 target entries before the frontmatter edits)

Fixes #1292

QA verdict: AC_MET_BUT_NOT_A_PLUS — acceptance criteria met, but not A+. The run broke to this PR for review rather than entering the quality loop; see the QA review comment for improvement notes.


🤖 Generated by sequant run

Entire-Checkpoint: 434e8e22ecdb
…the allowed-tools gate

QA showed Bash(rm -rf:*) and Bash(gh api -X:*) passed the exact <tool> * match. Any wildcard entry for gh api/rm/mv/find/sed/cp is now rejected unless BROAD_ALLOWLIST names it with a reason; the five narrowed clean/setup entries are allowlisted.

Entire-Checkpoint: 392eb207a31d
@admarble
admarble merged commit f70dbb9 into main Oct 5, 2026
11 checks passed
@admarble
admarble deleted the feature/1292-fix-skills-narrow-the-broad-allowed-tools-grants-t branch October 5, 2026 19:01
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.

fix(skills): narrow the broad allowed-tools grants the portal didn't flag — qa gh api, clean rm/find, setup curl/sed

1 participant