fix(guard): cover 4 DIFC labeling gaps — get_code_quality_finding, ui_get, add_gpg_key, add_ssh_key#7765
Merged
Merged
Conversation
…d_gpg_key, add_ssh_key
Copilot
AI
changed the title
[WIP] Fix guard coverage gaps for GitHub operations
fix(guard): cover 4 DIFC labeling gaps — get_code_quality_finding, ui_get, add_gpg_key, add_ssh_key
Jun 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens DIFC guard coverage in the Rust GitHub guard by explicitly classifying and labeling four previously-unhandled operations (two repo-scoped reads and two account-scoped CLI writes), reducing the risk of unclassified reads/writes bypassing expected secrecy/inperity tagging.
Changes:
- Add
add_gpg_keyandadd_ssh_keyto the guard’s write-operation classification list. - Add new
apply_tool_labelsmatch arms forget_code_quality_finding,ui_get(method-dispatch), andadd_gpg_key/add_ssh_key. - Add unit tests covering the new tool rules.
Show a summary per file
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/tools.rs | Adds two CLI key-management operations to WRITE_OPERATIONS and updates write-op classification tests. |
| guards/github-guard/rust-guard/src/labels/tool_rules.rs | Adds DIFC labeling rules for the four operations plus unit tests for the new labeling behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
This was referenced Jun 19, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Four operations from
github-mcp-serverand the GitHub CLI had no explicit DIFC rules in the guard, risking write operations bypassing classification or read operations missing secrecy/integrity labels.tools.rs— new write operationsadd_gpg_key— pre-emptive synthetic entry forgh gpg-key add(POST /user/gpg_keys)add_ssh_key— pre-emptive synthetic entry forgh ssh-key add(POST /user/keys,/user/ssh_signing_keys)Both inserted at sorted positions in
WRITE_OPERATIONS.tool_rules.rs— new DIFC match armsget_code_quality_finding— repo-visibility secrecy + writer integrity, mirroring other repo-scoped read tools:ui_get— method-dispatch mirroring existing standalone counterparts:add_gpg_key | add_ssh_key— user-scoped private secrecy + writer integrity, matching the pattern used byadd_deploy_keyand other pre-emptive CLI-only operations:Tests added for all four new rules.