Prevent private secrecy taint for public-scope repo reads when visibility lookup is unknown - #10472
Conversation
There was a problem hiding this comment.
Pull request overview
Updates repository visibility fallback behavior to avoid private taint under public policy scope.
Changes:
- Treats unknown repository visibility as public under public scope.
- Applies the fallback to tool and response labeling.
- Adds an
actions_listregression test.
Show a summary per file
| File | Description |
|---|---|
labels/tool_rules.rs |
Changes tool resource secrecy fallback. |
labels/helpers.rs |
Changes shared visibility secrecy fallback. |
labels/mod.rs |
Adds regression coverage. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
| .scopes | ||
| .iter() | ||
| .any(|scope| matches!(scope.scope_kind, ScopeKind::Public)) | ||
| { | ||
| return vec![]; |
| .scopes | ||
| .iter() | ||
| .any(|scope| matches!(scope.scope_kind, super::helpers::ScopeKind::Public)) | ||
| { | ||
| return vec![]; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS References: §30667622058
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30667623195
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30667623194
|
mcpg v0.4.8 alone did not fix the block: run 31082817368 still tagged resource:actions_list / actions_get secrecy=private and filtered every read. github/gh-aw-mcpg#10472 only returns public secrecy when the visibility lookup is unknown AND the policy scope includes Public, and the gateway was still reporting allowOnlyPublic=false under automatic lockdown. Setting allowed-repos: public emits a literal "repos": "public" so the precondition is unambiguously met. It must be the string form — a specific owner/repo does not satisfy it, which is why the earlier array attempt could not have worked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Public-repo workflows could end up with
private:<owner/repo>secrecy after reading their own repo via GitHub MCP, which then made safe-output writes impossible (noop,missing_tool,push_repo_memory). The failure mode was triggered when repo visibility resolution was unavailable and labeling fell back to private semantics despite a public-only policy scope.Secrecy fallback semantics (public scope)
[](public) when:Public.Labeling consistency across code paths
apply_repo_visibility_secrecy(...)now avoids introducingprivate:*underPublicscope on unknown visibility.repo_visibility_secrecy(...)now uses the same rule to prevent path-dependent drift.Regression coverage
actions_listproving that unknown visibility underPublicscope does not taint secrecy.private:<owner/repo>secrecy tags, blocking every safe-output write #10465