Add daily GitHub guard coverage checker workflow (MCP + CLI)#2279
Add daily GitHub guard coverage checker workflow (MCP + CLI)#2279
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/da211c00-c22b-47fa-a55a-c73cad72b641
|
@copilot it is also important to look at github cli operations and identify any gaps in the github guard implemenation https://github.com/cli/cli |
…tions Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/37f71d5b-7091-4a97-847e-f297587b0a82
Added in 8a6e2c6. The workflow now also scans Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot update the title and summary |
…scope Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/d4bd8162-4650-4db6-88c8-12f0395337ac
Updated in 262ff2f. The workflow Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds a new scheduled gh-aw workflow to continuously check that the Rust GitHub guard’s tool classification and DIFC labeling rules stay in sync with upstream github/github-mcp-server (and relevant GitHub CLI write operations), filing an issue when new coverage gaps appear.
Changes:
- Introduces a new agentic workflow prompt (
github-mcp-guard-coverage-checker.md) that defines how to discover upstream tools/CLI writes and detect classification/labeling/staleness gaps with cache-based deduping. - Adds the compiled gh-aw lock workflow (
github-mcp-guard-coverage-checker.lock.yml) to run the prompt daily and on-demand with safe-outputs issue creation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/github-mcp-guard-coverage-checker.md | New workflow manifest/prompt describing discovery + gap detection + issue/noop behavior. |
| .github/workflows/github-mcp-guard-coverage-checker.lock.yml | Generated compiled workflow implementing the manifest in GitHub Actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| A tool has a **labeling gap** if it is in the upstream MCP tool list AND has no explicit match arm in `apply_tool_labels`. This is lower severity than a classification gap, but still important for DIFC correctness — read tools that return repo-scoped data (issues, PRs, code, files) should have explicit secrecy/integrity rules. | ||
|
|
There was a problem hiding this comment.
Step 5.2 defines a "labeling gap" as any upstream tool that lacks an explicit apply_tool_labels match arm. That criterion is so broad it conflicts with the later guidance to avoid false positives and will likely flag many tools where default labeling is intentionally sufficient. Consider narrowing this to tools that are expected to be repo-scoped (per the secrecy spec list of repo-scoped read tools) or tools where the default labels are known to be incomplete, and explicitly document that scope here.
| A tool has a **labeling gap** if it is in the upstream MCP tool list AND has no explicit match arm in `apply_tool_labels`. This is lower severity than a classification gap, but still important for DIFC correctness — read tools that return repo-scoped data (issues, PRs, code, files) should have explicit secrecy/integrity rules. | |
| A tool has a **labeling gap** if **both** of the following are true: | |
| - It is in the upstream MCP tool list **and** is in a category where explicit labeling is expected (for example, repo-scoped read tools that return issues, PRs, code, files, or other repository data, per the secrecy spec list of repo-scoped read tools, or tools whose default labels are known to be incomplete). | |
| - It has **no explicit match arm** in `apply_tool_labels`. | |
| This is lower severity than a classification gap, but still important for DIFC correctness — read tools that return repo-scoped data (issues, PRs, code, files) should have explicit secrecy/integrity rules. Tools outside these categories (for example, clearly non-repo-scoped tools where the default labeling is intentionally sufficient) **must not** be treated as labeling gaps solely because they lack an explicit `apply_tool_labels` match arm. |
| safe-outputs: | ||
| create-issue: | ||
| title-prefix: "[guard-coverage] " | ||
| labels: [guard, automation, security] | ||
| max: 1 |
There was a problem hiding this comment.
The PR description says the workflow will create a "[guard-coverage]-labeled" issue, but the workflow config only applies guard, automation, and security labels (the [guard-coverage] string is only in the title prefix). Either add a guard-coverage label here or update the PR description/wording to reflect that it's a title prefix rather than a label.
| If those paths don't exist, search the repository structure: | ||
|
|
||
| ``` | ||
| Use github get_file_contents with owner=github, repo=github-mcp-server, path=., ref=main | ||
| ``` | ||
|
|
There was a problem hiding this comment.
The prompt suggests using get_file_contents with path=. to "search the repository structure". The GitHub get_file_contents tool maps to the contents API which expects a real path (or an empty path for repo root); . is not a valid repo path and will typically 404, causing this fallback discovery step to fail. Prefer using search_code to locate tool registration patterns (e.g., AddTool(), or direct reads of known directories/files rather than relying on path=..
There was a problem hiding this comment.
Fixed in a830bcb. The get_file_contents path=. fallback is replaced with search_code query=AddTool repo:github/github-mcp-server, which locates tool registration files directly without relying on an invalid repo-root path. The matched files are then read to extract all AddTool( call sites and registered tool names.
…code Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/64b92e38-071d-44dd-8714-cf9a757b6649
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…dness - Remove pull-requests: read (unused — workflow only reads source files) - Increase timeout from 20 to 30 minutes (reads 3 large repos) - Add last_all_gaps cache key to detect regressions: gaps that were fixed then reappeared are now re-reported instead of silently ignored Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The GitHub guard's tool classification (
tools.rs) and DIFC labeling rules (tool_rules.rs) can drift from the upstreamgithub/github-mcp-serveras new tools are added, leaving write operations unclassified or sensitive read responses without secrecy/integrity labels. Additionally, the GitHub CLI (cli/cli) exposes write operations that may have no equivalent MCP tool and no guard coverage.New workflow:
github-mcp-guard-coverage-checkerworkflow_dispatchgithub/github-mcp-serverREADME and source files via GitHub MCP to build a canonical MCP tool listcli/clipkg/cmd/write-command directories (pr, issue, repo, release, gist, workflow, label, project, secret, variable, org) to extract REST endpoints and map them to MCP tool equivalentsWRITE_OPERATIONS/READ_WRITE_OPERATIONSand not caught by prefix patterns (merge_*,delete_*,update_*,create_*)apply_tool_labelsthat return repo-scoped dataWRITE_OPERATIONSentry and a note to request the corresponding tool from the MCP server teamknown_gapsacross runs; only reports newly discovered gaps to avoid issue spam[guard-coverage]-labeled issue with concrete Rust fix snippets, or callsnoopif coverage is completeThe workflow name is "GitHub Guard Coverage Checker (MCP + CLI)" to clearly reflect the dual-source audit scope.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.