Skip to content

[Repo Assist] guard: add assign_copilot_to_issue_with_intent to WRITE_OPERATIONS and DIFC labels - #9828

Merged
lpcox merged 5 commits into
mainfrom
repo-assist/fix-issue-9813-guard-copilot-intent-f400c101f0fb6b8b
Jul 22, 2026
Merged

[Repo Assist] guard: add assign_copilot_to_issue_with_intent to WRITE_OPERATIONS and DIFC labels#9828
lpcox merged 5 commits into
mainfrom
repo-assist/fix-issue-9813-guard-copilot-intent-f400c101f0fb6b8b

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is a pull request from Repo Assist, an automated AI assistant.

Closes #9813

Root Cause

The assign_copilot_to_issue_with_intent MCP tool was identified by the guard coverage checker as a write operation present in the upstream github-mcp-server but absent from:

  • WRITE_OPERATIONS in guards/github-guard/rust-guard/src/tools.rs
  • The DIFC label match arm in guards/github-guard/rust-guard/src/labels/tool_rules.rs

Fix

Added assign_copilot_to_issue_with_intent alongside its sibling assign_copilot_to_issue in both files:

  • tools.rs: inserted alphabetically between assign_copilot_to_issue and cancel_workflow_run
  • tool_rules.rs: added to the existing Copilot write arm next to assign_copilot_to_issue and request_copilot_review, inheriting the same repo-visibility secrecy and writer integrity handling

Trade-offs

No trade-offs — this is a straightforward gap fill. The new tool shares the same write semantics as its sibling and belongs in the same classification bucket.

Test Status

All 596 Rust guard unit tests pass (cargo test). Go build requires go 1.25.0 which isn't available in this sandbox (network-blocked toolchain download); the Rust changes are isolated to the guard and do not touch Go code.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • awmgmcpg
  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"
    - "proxy.golang.org"

See Network Configuration for more information.

Generated by Repo Assist · 91.6 AIC · ⊞ 11.1K ·
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

…d tool_rules

Closes #9813

The assign_copilot_to_issue_with_intent tool was identified as a write
operation missing from the guard's WRITE_OPERATIONS list (tools.rs) and
without an explicit DIFC label rule (tool_rules.rs). Add it alongside
its sibling assign_copilot_to_issue in both files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox
lpcox marked this pull request as ready for review July 22, 2026 21:37
Copilot AI review requested due to automatic review settings July 22, 2026 21:37

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.

Pull request overview

Adds guard coverage for the new Copilot issue-assignment tool.

Changes:

  • Classifies the tool as a write operation.
  • Applies repository secrecy and writer-integrity labels.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/tools.rs Adds write classification.
guards/github-guard/rust-guard/src/labels/tool_rules.rs Adds DIFC labeling.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

"archive_project_item", // gh project item-archive — archives a Projects v2 item
"archive_repository", // gh repo archive — blocked: repo settings change unsupported
"assign_copilot_to_issue",
"assign_copilot_to_issue_with_intent", // upstream Copilot intent assignment write
| "rerun_workflow_job"
// Copilot / repo settings / revert
| "assign_copilot_to_issue"
| "assign_copilot_to_issue_with_intent"
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@lpcox

lpcox commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in e566a0a with regression coverage for assign_copilot_to_issue_with_intent in both write-operation classification and DIFC label application tests.

Copilot finished work on behalf of lpcox July 22, 2026 22:08
Copilot AI requested a review from lpcox July 22, 2026 22:08
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@lpcox

lpcox commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

…-9813-guard-copilot-intent-f400c101f0fb6b8b

# Conflicts:
#	guards/github-guard/rust-guard/src/tools.rs

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Addressed in 68197e9a.

Copilot finished work on behalf of lpcox July 22, 2026 23:32
@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — gVisor

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: gVisor (runsc) kernel-level isolation

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) unknown tool [-32602] for all 7 BLOCKED
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) unauthenticated — no GH_TOKEN BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) unauthenticated — no GH_TOKEN BLOCKED

Overall: PASS

Part B: gateway strips all write tools — every attempt returns MCP error [-32602] unknown tool. Parts D & E: gh unauthenticated in gVisor runtime; all REST/GraphQL writes rejected at auth layer.

References: §29966437591

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default AWF

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 (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) unknown tool [-32602] from gateway BLOCKED
C CLI reads (list issues, get file) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) unauthenticated (no GH_TOKEN) BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) unauthenticated (no GH_TOKEN) BLOCKED

Overall: PASS

Notes:

  • Part B: gateway returns MCP error [-32602] unknown tool for all 7 write tool calls — write tools are stripped at gateway level, confirming gateway enforcement.
  • Parts D & E: gh CLI carries no token so all REST/GraphQL writes fail at auth before reaching GitHub API.

References: §29966437606

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — docker-sbx

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: docker-sbx (KVM-isolated microVM)

Part Surface Op Result Expected Status
A MCP reads data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) Error [-32602] unknown tool (gateway blocks — 0/22 tools are writes) BLOCKED
C CLI reads data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) rejected (gh unauthenticated) BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) rejected (gh unauthenticated) BLOCKED

Overall: PASS

References: §29966437730

🔒 mcpg read-only stress (docker-sbx runtime) by Read-Only Stress: docker-sbx runtime

@lpcox
lpcox merged commit 11fdf44 into main Jul 22, 2026
37 checks passed
@lpcox
lpcox deleted the repo-assist/fix-issue-9813-guard-copilot-intent-f400c101f0fb6b8b branch July 22, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[guard-coverage] Guard coverage gap: 1 operations from github-mcp-server / GitHub CLI not fully covered

3 participants