Add list_code_scanning_alerts query-bounding guardrail and regression tests#46198
Conversation
…guardrails Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…rails Add state: open and severity: critical,high guardrail to both GitHub MCP tools prompt files to prevent unbounded code-scanning queries that produce oversized responses and break downstream workflow runs. Add three regression tests in prompt_validation_test.go: - TestGitHubMCPToolsPromptBoundsCodeScanningAlertQueries - TestGitHubMCPToolsWithSafeOutputsPromptBoundsCodeScanningAlertQueries - TestGitHubMCPToolsPromptIncludedForCodeSecurityToolset Closes #46162 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot use the field selection feature from the GitHub MCP server 1.6.0 to apply these APIs. Update prompt. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…er 1.6.0) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit Both prompt files now include a Field selection guardrail documenting the Note: The SKILL.md Pull Requests section is also updated to prefer the |
Unbounded
list_code_scanning_alertsMCP calls return oversized payloads that break downstream workflow runs. Both GitHub MCP tools prompt files now instruct agents to always includestate: openandseverity: critical,high.Changes
actions/setup/md/github_mcp_tools_prompt.md— added**Code scanning queries**guardrail line requiringstate: openandseverity: critical,highon everylist_code_scanning_alertscallactions/setup/md/github_mcp_tools_with_safeoutputs_prompt.md— same guardrail in the safe-outputs variantpkg/workflow/prompt_validation_test.go— three new regression tests:TestGitHubMCPToolsPromptBoundsCodeScanningAlertQueries— asserts the plain prompt file contains both required parametersTestGitHubMCPToolsWithSafeOutputsPromptBoundsCodeScanningAlertQueries— same assertion on the with-safeoutputs variantTestGitHubMCPToolsPromptIncludedForCodeSecurityToolset— compiles acode_security-toolset workflow and verifies the generated lock file references one of the guardrail-carrying prompt filesThe guardrail text added to both prompt files: