Repository navigation
add optional secret hiding to secret scanning alert tools - #3838
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The security-sensitive schema and REST changes rely solely on upstream hide_secret support for secret omission across output formats, requiring maintainer judgment.
No open issues 🎉
What changed in this PR
Adds opt-in secret omission to the GitHub MCP Server’s secret scanning alert tools. Callers can set hide_secret: true to request responses without secret values; omitted or false keeps existing behavior.
Changes:
- Add optional
hide_secretinputs to single-alert and repository-list tools and forward them to the REST API. - Preserve existing filters, pagination, permissions, and output labels.
- Add tests for omitted, false, and true options across direct and protocol calls, plus updated documentation and schema snapshots.
| File | Description |
|---|---|
| README.md | Documents the optional parameter for both tools. |
| pkg/github/security_outputs.go | Adds typed inputs for the secret-hiding option. |
| pkg/github/secret_scanning.go | Exposes the option and includes it in REST requests. |
| pkg/github/secret_scanning_test.go | Covers query forwarding, output formats, labels, and pagination defaults. |
| pkg/github/__toolsnaps__/list_secret_scanning_alerts.snap | Records the updated list-tool input schema. |
| pkg/github/__toolsnaps__/get_secret_scanning_alert.snap | Records the updated single-alert input schema. |
Review effort: Max (dynamic)
SamMorrowDrums
approved these changes
Nov 13, 2026
SamMorrowDrums
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Verified hide_secret is in the REST OpenAPI spec for both endpoints, go-github v92 doesn't expose it (so the hand-built request is justified), and path escaping matches existing convention. CI green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Callers can request secret scanning alert details without receiving secret values. Both alert tools now accept optional
hide_secret, with existing behavior unchanged unless it is true.Why
The REST API supports excluding secrets, but these tools do not expose that option. Filtering at the API avoids retrieving secret values just to discard them.
What changed
hide_secretto the REST API for single-alert and repository-list requests.MCP impact
Both tools gain an optional boolean. Omitted or false retains secret values; true requests their omission from both text and structured responses.
Prompts tested (tool changes only)
Security / limits
Existing authorization and private-untrusted labels remain unchanged. Secret omission is opt-in and happens at the REST API, not after fetching the secret.
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testscript/lintpassed.script/testpassed with the full race-enabled suite.UPDATE_TOOLSNAPS=true script/test,script/generate-docs, andgo build ./cmd/github-mcp-server ./cmd/mcpcurlpassed.Docs
Generated tool documentation includes the new option.