Skip to content

Complete DIFC labeling for get_file_blame - #16346

Merged
lpcox merged 3 commits into
mainfrom
copilot/guard-coverage-fix-get-file-blame
Nov 11, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/guard-coverage-fix-get-file-blame

Conversation

Copilot AI commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

get_file_blame lacked a canonical tool-name entry and explicit response labeling, leaving returned blame data outside the repository-scoped file-content rules.

  • Changes
    • Add GET_FILE_BLAME and use it in the existing request-label rule.
    • Apply repository visibility and file-content integrity labels to blame response items and paths.
    • Extend regression coverage to verify blame labeling across refs.
tool_names::GET_FILE_CONTENTS
| tool_names::GET_FILE_BLAME
| tool_names::GET_FILE_CONTENTS_FF_FIELDS_PARAM => { /* file-content labels */ }

Copilot AI changed the title [WIP] Fix guard coverage for get_file_blame operation Complete DIFC labeling for get_file_blame Nov 11, 2026
Copilot AI requested a review from lpcox November 11, 2026 18:46
@lpcox
lpcox marked this pull request as ready for review November 11, 2026 18:54
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 18:54

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

A critical regression leaves sensitive-path blame responses in public repositories without private labels, potentially allowing restricted data through response filtering and omitting those labels during propagation.

1 open issue
What changed in this PR

Extends the GitHub guard’s DIFC labeling for get_file_blame, routing responses through existing file-content rules to address the coverage gap tracked in #16314.

Changes:

  • Adds a canonical blame tool-name constant and uses it in request labeling.
  • Applies repository-visibility secrecy and revision-based integrity to blame response items and paths.
  • Extends response-label regression coverage across refs.
File Description
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Uses the canonical blame constant in the existing request rule.
guards/​github-guard/​rust-guard/​src/​labels/​response_paths.rs Adds blame to file-content path labeling.
guards/​github-guard/​rust-guard/​src/​labels/​response_items.rs Adds blame to file-content item labeling.
guards/​github-guard/​rust-guard/​src/​labels/​mod.rs Extends response-label tests to blame and replaces tool-name literals.
guards/​github-guard/​rust-guard/​src/​labels/​constants.rs Defines GET_FILE_BLAME.

Review effort: Max (auto)

// === File Contents - repo-scoped secrecy ===
tool_names::GET_FILE_CONTENTS | tool_names::GET_FILE_CONTENTS_FF_FIELDS_PARAM => {
tool_names::GET_FILE_CONTENTS
| tool_names::GET_FILE_BLAME
@lpcox

lpcox commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Fixed in 7af1b1e. Both response labelers now reuse apply_tool_labels, and a regression test confirms .env blame responses retain private secrecy.

@lpcox
lpcox merged commit 38b20f8 into main Nov 11, 2026
29 of 30 checks passed
@lpcox
lpcox deleted the copilot/guard-coverage-fix-get-file-blame branch November 11, 2026 21:30
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: 1 operation from github-mcp-server / GitHub CLI not fully covered

3 participants