Open
Constrain list_code_scanning_alerts prompt usage with explicit state/severity bounds#43744
list_code_scanning_alerts prompt usage with explicit state/severity bounds#43744Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Audit workflow prompts for list_code_scanning_alerts
Constrain Jul 6, 2026
list_code_scanning_alerts prompt usage with explicit state/severity bounds
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens prompt/documentation guidance around using the GitHub MCP server’s list_code_scanning_alerts tool to reduce oversized responses by requiring bounded queries, and adds a Go regression test intended to prevent prompt drift.
Changes:
- Added explicit prompt guidance to always include
state: openandseverity: critical,highwhen invokinglist_code_scanning_alerts. - Added a regression test to ensure selected workflow/prompt surfaces keep these bounds near the tool reference.
- Updated MCP documentation in
.githuband the docs site to reflect the bounded-query requirement.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/code_scanning_prompt_bounds_test.go | Adds a regression test scanning key prompt/doc files for bounded list_code_scanning_alerts usage. |
| docs/src/content/docs/guides/mcps.md | Adds bounded-query guidance for list_code_scanning_alerts in the docs site guide. |
| .github/skills/github-mcp-server/SKILL.md | Adds bounded-query guidance for list_code_scanning_alerts in the GitHub MCP server skill. |
| .github/aw/github-mcp-server.md | Adds bounded-query guidance for list_code_scanning_alerts in the .github/aw MCP server guidance doc. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Low
Comment on lines
+15
to
+19
| paths := []string{ | ||
| filepath.Join("..", "..", ".github", "workflows", "github-mcp-structural-analysis.md"), | ||
| filepath.Join("..", "..", ".github", "aw", "github-mcp-server.md"), | ||
| filepath.Join("..", "..", ".github", "skills", "github-mcp-server", "SKILL.md"), | ||
| } |
Comment on lines
+33
to
+37
| hasBoundedReference := false | ||
| for i, line := range lines { | ||
| if !strings.Contains(line, "list_code_scanning_alerts") { | ||
| continue | ||
| } |
| - `get_code_scanning_alert` - Get details of a specific alert | ||
| - `create_code_scanning_alert` - Create a code scanning alert | ||
|
|
||
| When invoking `list_code_scanning_alerts` from workflow prompts/templates, always include `state: open` and `severity: critical,high`. |
pelikhan
reviewed
Jul 6, 2026
| @@ -0,0 +1,51 @@ | |||
| //go:build !integration | |||
Contributor
Author
There was a problem hiding this comment.
Done — the file has been deleted in the latest commit.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.
Hippo flagged recurring oversized MCP responses from unbounded
list_code_scanning_alertsusage in workflow prompt surfaces. This PR tightens prompt guidance to require bounded queries and adds a regression check so the bounds remain present.Prompt/template guardrails
state: openseverity: critical,high.github/aw/github-mcp-server.md.github/skills/github-mcp-server/SKILL.mddocs/src/content/docs/guides/mcps.mdRegression coverage
pkg/cli/code_scanning_prompt_bounds_test.goto assert key workflow/prompt docs that referencelist_code_scanning_alertsalso include the required bounds near that reference.Illustrative guidance pattern