Skip to content

Preserve public secrecy labels for unknown Actions repo visibility - #10873

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-private-tag-in-actions-data
Aug 8, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/fix-private-tag-in-actions-data

Conversation

Copilot AI commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

actions_list could receive private:* secrecy labels when repository visibility lookup was unavailable, even under an explicit repos: public policy. This blocked Actions reads and prevented safe output in public-repository workflows.

  • Public-scope fallback

    • Return empty secrecy labels for unknown visibility when the policy includes Public.
    • Apply the behavior in both tool-resource and response-label helper paths.
  • Regression coverage

    • Cover actions_list resource labeling with an existing private label under public scope.
    • Cover the shared repository-visibility secrecy helper.
if ctx.scopes.iter().any(|scope| matches!(scope.scope_kind, ScopeKind::Public)) {
    return vec![];
}

Copilot AI changed the title [WIP] Fix public repo Actions data tagging as private in mcpg v0.4.8 Preserve public secrecy labels for unknown Actions repo visibility Aug 8, 2026
Copilot AI requested a review from lpcox August 8, 2026 16:03
@lpcox
lpcox marked this pull request as ready for review August 8, 2026 16:14
Copilot AI balanced review requested due to automatic review settings August 8, 2026 16:14

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

Updates GitHub guard labeling so unknown repository visibility remains public under an explicit public-repository policy.

Changes:

  • Adds public-scope fallback to tool and response secrecy-label helpers.
  • Updates actions_list regression coverage.
  • Adds direct helper-level regression coverage.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/labels/tool_rules.rs Applies public fallback during tool-resource labeling.
guards/github-guard/rust-guard/src/labels/mod.rs Updates actions_list regression expectations.
guards/github-guard/rust-guard/src/labels/helpers.rs Applies and tests shared visibility fallback behavior.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔒 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 list_issues data returned ALLOWED ✅
A MCP list_pull_requests data returned ALLOWED ✅
A MCP get_file_contents (README.md) data returned ALLOWED ✅
A MCP list_commits data returned ALLOWED ✅
B MCP add_issue_reaction Error [-32602]: unknown tool BLOCKED ✅
B MCP star_repository Error [-32602]: unknown tool BLOCKED ✅
B MCP create_issue Error [-32602]: unknown tool BLOCKED ✅
B MCP add_issue_comment Error [-32602]: unknown tool BLOCKED ✅
B MCP create_branch Error [-32602]: unknown tool BLOCKED ✅
B MCP create_or_update_file Error [-32602]: unknown tool BLOCKED ✅
B MCP create_pull_request Error [-32602]: unknown tool BLOCKED ✅
C CLI list_issues data returned ALLOWED ✅
C CLI list_pull_requests data returned ALLOWED ✅
C CLI get_file_contents data returned ALLOWED ✅
D CLI REST: POST reaction gh unauthenticated (blocked) BLOCKED ✅
D CLI REST: PUT star gh unauthenticated (blocked) BLOCKED ✅
D CLI REST: POST issue gh unauthenticated (blocked) BLOCKED ✅
D CLI REST: POST comment gh unauthenticated (blocked) BLOCKED ✅
D CLI REST: PUT file gh unauthenticated (blocked) BLOCKED ✅
E CLI GraphQL: addReaction gh unauthenticated (blocked) BLOCKED ✅
E CLI GraphQL: addStar gh unauthenticated (blocked) BLOCKED ✅
E CLI GraphQL: createIssue gh unauthenticated (blocked) BLOCKED ✅

Overall: PASS

Part B enforcement: Gateway enforces read-only via tool allowlist — write tools absent from proxied tool set (MCP error -32602 unknown tool). Gateway-level enforcement confirmed.

Parts D & E: gh CLI is unauthenticated; all REST/GraphQL writes rejected at auth layer.

Run: §31265661693

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔒 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 list_issues, list_prs, get_file_contents, list_commits data returned ALLOWED ✅
B MCP reaction/star/issue/comment/branch/file/PR (7 tools) unknown tool [-32602] BLOCKED ✅
C CLI list_issues, get_file_contents via github bridge data returned ALLOWED ✅
D CLI REST writes via gh rejected (gh unauthenticated) BLOCKED ✅
E CLI GraphQL mutations via gh rejected (gh unauthenticated) BLOCKED ✅

Overall: PASS

Full Report

Part A — MCP Reads ✅

  • list_issues: 3 issues returned
  • list_pull_requests: 3 PRs returned
  • get_file_contents (README.md): downloaded successfully
  • list_commits: 3 commits returned

Part B — MCP Writes ✅ (all BLOCKED)

All 7 write tools return Error [-32602]: unknown tool — the gateway exposes only 22 read-only tools. Write tools are absent from the exposed tool list entirely.

⚠️ Enforcement mechanism: tool list filtering (write tools not registered). No active "access denied" error — but no write succeeded.

Gateway tool list (22, read-only): get_commit, get_file_contents, get_label, get_latest_release, get_release_by_tag, get_tag, issue_read, list_branches, list_commits, list_issue_fields, list_issue_types, list_issues, list_pull_requests, list_releases, list_repository_collaborators, list_tags, pull_request_read, search_code, search_commits, search_issues, search_pull_requests, search_repositories

Part C — CLI Reads ✅

  • github list_issues: 3 issues returned
  • github get_file_contents: README.md downloaded

Part D — CLI REST Writes ✅

gh CLI not authenticated (no GH_TOKEN). All 6 REST write attempts rejected.

Part E — GraphQL Mutations ✅

gh CLI not authenticated. All 3 GraphQL mutation attempts rejected.

References: §31265661711

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔒 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 (issues/PRs/file/commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) unknown tool [-32602] BLOCKED ✅
C CLI reads (list_issues via gateway CLI) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment/file) HTTP 401 Bad credentials BLOCKED ✅
E CLI GraphQL mutations (addReaction/addStar/createIssue) HTTP 401 Bad credentials BLOCKED ✅

Overall: PASS

Notes:

  • Part B: gateway returns MCP error [-32602]: unknown tool for all write tools — write-tool names are absent from the gateway-exposed tool set.
  • Parts D/E: gh CLI is unauthenticated (401), blocking all REST/GraphQL writes.
  • Part C read confirmed via github CLI bridge (gateway-backed).

References: §31265661728

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

@lpcox
lpcox merged commit 0b5bdae into main Aug 8, 2026
51 checks passed
@lpcox
lpcox deleted the copilot/fix-private-tag-in-actions-data branch August 8, 2026 17:03
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.

Public repo Actions data still tagged private: on mcpg v0.4.8 — #10465 fix incomplete

3 participants