Repository navigation
Tighten DIFC labeling for GitHub read metadata - #15496
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The organization-search change blocks public search results under strict/filter enforcement, even with repos: "all".
1 open issue
What changed in this PR
Refines GitHub read-metadata labeling in the Rust DIFC guard and protects coverage for the six tools identified in #15490.
Changes:
- Labels organization search as private-user metadata.
- Adds repository-scoped descriptions for repository trees while preserving visibility and integrity rules.
- Centralizes six tool names and extends metadata-label regression tests.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Updates labeling rules and adds regression cases. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Updates the organization-search secrecy assertion. |
guards/github-guard/rust-guard/src/labels/constants.rs |
Defines constants for the six read tools. |
Review effort: Max
| | "get_copilot_space" | ||
| | tool_names::LIST_STARRED_REPOSITORIES | ||
| | tool_names::GET_COPILOT_SPACE | ||
| | tool_names::SEARCH_ORGS |
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot address security review feedback |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
| let query = get_string_field(args, field_names::QUERY).unwrap_or_default(); | ||
|
|
||
| // If query looks repo-scoped, prefer repo-private scoping derived from args. | ||
| if query.contains("repository(") || query.contains("repositories(") { |
| // Organization queries | ||
| {queryPattern: regexp.MustCompile(`(?i)\borganization\s*\(`), toolName: "search_orgs"}, | ||
| // Organization queries (root-field constrained to reduce misrouting from token injection/mixed queries) | ||
| {queryPattern: regexp.MustCompile(`(?is)^\s*(?:query|mutation|subscription)?\s*[A-Za-z0-9_]*\s*(?:\([^)]*\))?\s*(?:@[A-Za-z0-9_]+(?:\([^)]*\))?\s*)*\{\s*organization\s*\(`), toolName: "graphql_organization"}, |
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Addressed in
Fixed in |
|
@copilot fix the failed linting test https://github.com/github/gh-aw-mcpg/actions/runs/40219631113/job/121252244029?pr=15496 |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Fixed the lint failure by replacing the |

The coverage report flagged six GitHub read tools for missing DIFC labels. Existing rules already cover most; this change tightens organization-search secrecy and repository-tree descriptions while protecting that coverage.
search_orgsas access-sensitive:private:usersecrecy with GitHub-controlled integrity.get_repository_treearepo:owner/repodescription, retaining repository-visibility secrecy and writer integrity.