Add pre-emptive guard coverage for 5 workflow run cancel/rerun operations#3095
Merged
Add pre-emptive guard coverage for 5 workflow run cancel/rerun operations#3095
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/6e8ae7f6-a12f-43d6-9862-e040edab6dcb Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add coverage for 5 missing GitHub CLI workflow-run operations
Add pre-emptive guard coverage for 5 workflow run cancel/rerun operations
Apr 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the GitHub Guard DIFC labeling rules to proactively classify upcoming gh run cancel / gh run rerun MCP tool operations as write operations, ensuring they receive repo-visibility secrecy and writer integrity (rather than falling through to default handling).
Changes:
- Added five workflow run cancel/rerun operation names to
WRITE_OPERATIONSintools.rs. - Added a
apply_tool_labelsmatch arm intool_rules.rsto apply repo-visibility secrecy + writer integrity for the five new operations. - Added unit tests in
tools.rsandlabels/mod.rsto assert the new operations are treated as writes and receive writer integrity.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/tools.rs | Classifies workflow run cancel/rerun operations as write operations and tests the classification. |
| guards/github-guard/rust-guard/src/labels/tool_rules.rs | Applies repo-scoped secrecy + writer integrity labeling for the new actions operations. |
| guards/github-guard/rust-guard/src/labels/mod.rs | Adds tests asserting writer integrity for the new operations via apply_tool_labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Neither
cancel_*norrerun_*are recognized prefix patterns intools.rs, so future MCP tools forgh run cancelandgh run rerunwould fall through to default handling, bypassing DIFC write-operation classification.Changes
tools.rs— Add 5 pre-emptive entries toWRITE_OPERATIONS:tool_rules.rs— Add match arm for all 5 operations following theactions_run_triggerpattern: repo-visibility secrecy + writer integrity:labels/mod.rs— Tests asserting writer integrity for all 5 new operations viaapply_tool_labels.