Skip to content

ci(ai-sweep): limit the scheduled sweep to adding the needs-triage label - #4085

Merged
vavallee merged 4 commits into
mainfrom
fix/ai-sweep-label-only
Nov 20, 2026
Merged

vavallee merged 4 commits into
mainfrom
fix/ai-sweep-label-only

Conversation

@vavallee

Copy link
Copy Markdown
Owner

Summary

Hardening for the nightly sweep. It reads untrusted issue text and held Bash(gh issue edit:*), which covers every edit flag. Its prompt (step 3) only ever adds needs-triage to unlabelled issues.

  • Allow Bash(gh issue edit * --add-label needs-triage). Claude Code permission rules accept * anywhere in the rule, and a compound command is split so each part must match.
  • Add --disallowedTools entries for the other gh issue edit flags (body, title, remove-label, assignees, milestone, project).
  • Limit: * also stands for any options before --add-label, so an allow rule alone cannot forbid --body x --add-label needs-triage. The deny list covers that, but it is a list of flags, not a closed set. The egress allowlist and no push token remain the backstops. Pins are unchanged.

Test plan

  • Workflow YAML parses. The rule syntax follows the Claude Code permissions docs (wildcard in the middle, deny rules apply when any subcommand matches). I could not run the scheduled workflow itself, so the first nightly run is the real check: it should still label unlabelled issues.

🤖 Generated with Claude Code

Hardening: the sweep reads untrusted issue text and held a blanket
gh issue edit permission. Allow only the needs-triage label add its
prompt uses and deny the other edit flags.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Signed-off-by: vavallee <vavallee@protonmail.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Signed-off-by: vavallee <vavallee@protonmail.com>
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vavallee vavallee closed this Nov 20, 2026
@vavallee vavallee reopened this Nov 20, 2026
@vavallee
vavallee merged commit a80c9dc into main Nov 20, 2026
42 checks passed
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.

1 participant