Skip to content

Add DIFC guard coverage for Copilot Automation tools - #16754

Merged
lpcox merged 3 commits into
mainfrom
copilot/guard-coverage-add-classifications
Nov 18, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/guard-coverage-add-classifications

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Eleven Copilot Automation tools lack explicit DIFC rules, and run_automation is missing from mutation classification.

  • Labeling: Add repository-visibility secrecy and reader integrity for seven read operations; writer integrity for create, update, delete, and run. Include automation IDs in resource descriptions when present.
  • Classification: Explicitly register all four mutations; this checkout has no generic create_ or update_ fallback.
  • Regression coverage: Cover all 11 tools across public/private repositories, read/write classification, and optional automation IDs.

@lpcox lpcox changed the title [WIP] Add classifications for Copilot Automation operations Add DIFC guard coverage for Copilot Automation tools Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 15:32
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 15:32
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Automation reads lack user-private secrecy labels, while updates bypass read authorization, allowing private definitions and existing configuration to be exposed without proper clearance.

2 open issues
What changed in this PR

Extends the Rust GitHub guard’s information-flow controls to cover all 11 Copilot Automation tools.

Changes:

  • Adds repository-visibility secrecy, reader/writer integrity, and optional automation IDs in resource descriptions.
  • Explicitly registers four automation mutations.
  • Adds regression tests for visibility, operation classification, and optional IDs.
File Description
guards/​github-guard/​rust-guard/​src/​tools.rs Registers automation mutations and adds classification tests.
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Adds automation labeling rules, descriptions, and visibility tests.
guards/​github-guard/​rust-guard/​src/​labels/​constants.rs Defines shared names for the 11 automation tools.

Review effort: Max (adaptive)

| tool_names::UPDATE_AUTOMATION
| tool_names::DELETE_AUTOMATION
| tool_names::RUN_AUTOMATION => {
secrecy = apply_repo_visibility_secrecy(&owner, &repo, repo_id, secrecy, ctx);
tool_names::RUN_AUTOMATION,
tool_names::STAR_REPOSITORY,
tool_names::UNSTAR_REPOSITORY,
tool_names::UPDATE_AUTOMATION,
@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback, merge main, and resolve conflicts

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback, merge main, and resolve conflicts

Merged main and resolved the overlapping automation guard changes in e9f4b49 and 612a4f3. Personal automation definitions now require private:user clearance unless the list explicitly requests shared automations, and update_automation is classified as read-write. make agent-finished passed, including all 729 Rust guard tests.

| tool_names::RUN_AUTOMATION => {
secrecy = apply_repo_visibility_secrecy(&owner, &repo, repo_id, secrecy, ctx);
// These operations can return personal definitions, even in public repositories.
if matches!(
@github-actions

Copy link
Copy Markdown
Contributor

Lock mcpg Read-Only Stress - default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues/list_pull_requests/get_file_contents/list_commits) data returned ALLOWED PASS
B MCP writes (issue_write/star_repository/add_issue_comment/create_branch/create_or_update_file/create_pull_request) all 6 targets absent from 23-tool catalog BLOCKED WARN
C CLI reads (github CLI list_issues/get_file_contents/list_commits) data returned ALLOWED PASS
D CLI REST writes not attempted - gh unauthenticated BLOCKED WARN
E CLI GraphQL mutations not attempted - gh unauthenticated BLOCKED WARN

Overall: INCONCLUSIVE

Part B: all 6 targeted write tools were absent from the github CLI exposed catalog (23 read-only tools only), so refusal only proves backend/toolset config, not independent gateway-level enforcement. Parts D/E: gh auth status showed no authenticated host, so proxied CLI/GraphQL write-blocking could not be exercised this run. No write leaked in any part; all reads succeeded.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 0f06fc4 into main Nov 18, 2026
28 checks passed
@lpcox
lpcox deleted the copilot/guard-coverage-add-classifications branch November 18, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[guard-coverage] Guard coverage gap: 11 Copilot Automation operations not fully covered

4 participants