Repository navigation
[Repo Assist] fix(rust-guard): cover Copilot Automation tools in guard labeling - #16710
Conversation
Closes #16689 Co-authored-by: Copilot <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE (no write leaked through either surface)
No reaction, star, issue, comment, branch, file, or PR was created.
|
There was a problem hiding this comment.
🟡 Changes recommended
The write-only classification of update_automation can expose private automation prompts while bypassing read-secrecy checks and secrecy-label accumulation.
1 open issue
What changed in this PR
Extends the Rust GitHub guard’s labeling and operation classification to cover all 11 Copilot Automation tools, addressing the coverage gap in #16689.
Changes:
- Adds shared tool-name constants with literal-value assertions.
- Applies repository secrecy and reader/writer integrity labels to automation operations.
- Adds explicit mutation classifications and regression tests.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/tools.rs |
Adds automation mutations to the write inventory and tests classification. |
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Adds repository-scoped automation labels and integrity tests. |
guards/github-guard/rust-guard/src/labels/constants.rs |
Defines constants for all 11 automation tools and checks their values. |
Review effort: Max (adaptive)
| tool_names::RUN_AUTOMATION, // POST — starts a manual Copilot Automation run | ||
| tool_names::STAR_REPOSITORY, | ||
| tool_names::UNSTAR_REPOSITORY, | ||
| tool_names::UPDATE_AUTOMATION, |

🤖 This is an automated pull request from Repo Assist.
Closes #16689
Root cause
The 11 Copilot Automation tools registered upstream in
pkg/github/agent_automations.gohad no explicit DIFC labeling arms inapply_tool_labels.run_automationalso did not match any write prefix and was absent fromtools.rs.update_automationwas also missing: it falls under none of the existing prefix checks, so it is added explicitly.Fix
labels/constants.rs: addtool_namesconstants for all 11 tools, with literal-value assertions.labels/tool_rules.rs:list_automations,get_automation,list_automation_revisions,get_automation_revision,list_available_automation_tools,list_available_automation_triggers,get_automations_configuration_for_repository): S = S(repo), I = reader.create_automation,update_automation,delete_automation,run_automation): added to the repo-scoped write arm, giving S = S(repo), I = writer.tools.rs: addcreate_automation,delete_automation,run_automationandupdate_automationtoWRITE_OPERATIONS(sorted). Thedelete_prefix already matchesdelete_automation, so the explicit entry only keeps the source-bucket inventory consistent.Trade-offs
Reader integrity for the read tools follows the issue's suggestion, treating automation configuration as repository-reader data that should not authorize writes. Maintainers may prefer stricter secrecy (private scope) for these reads; that is a one-line change.
Test Status
cargo test(guards/github-guard/rust-guard): 727 passed, 0 failed (new tests for write classification, read non-classification, and apply_tool_labels scoping).cargo clippy --all-targets: no new warnings.cargo fmt --check: only a pre-existing diff intools.rs(around line 164, unrelated to this change) remains.Add this agentic workflow to your repo
To install this agentic workflow, run