Close GitHub guard coverage gaps for governance tools - #12538
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Critical DIFC scope gaps leave valid organization and enterprise operations improperly labeled.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds operation classification and DIFC labeling for GitHub governance tools. Organization and enterprise scopes remain incorrectly handled.
Changes:
- Classifies governance read/write operations.
- Adds DIFC labels and coverage tests.
- Requires scope-aware labeling for non-repository targets.
File summaries
| File | Review |
|---|---|
guards/github-guard/rust-guard/src/tools.rs |
Adds write classifications and tests. |
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Adds governance labels, but read and write tools incorrectly apply repository-only labeling to organization and enterprise targets. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "repository_ruleset_read" | "custom_properties_read" => { | ||
| // Governance metadata is repository/org-scoped and requires writer-level trust. | ||
| // S = S(repo); I = writer. | ||
| secrecy = apply_repo_visibility_secrecy(&owner, &repo, repo_id, secrecy, ctx); | ||
| integrity = writer_integrity(repo_id, ctx); |
| | "custom_properties_write" | ||
| | "create_repository_ruleset" |
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked. The catalog exposed to the agent contains only 23 read tools (get_, list_, search_*, issue_read, pull_request_read) — none of the targeted write tools (
|
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Details:
No write succeeded on any surface in this run.
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
The GitHub guard lacked operation classification and explicit DIFC rules for five current MCP tools, including repository governance reads/writes and duplicate detection. This left mutating operations insufficiently covered.
Operation classification
custom_properties_writeto read-write operations.create_repository_rulesetto write operations.DIFC labeling
find_duplicate— private-writer integrity.repository_ruleset_readcustom_properties_readcustom_properties_writecreate_repository_ruleset