Replace GitHub MCP server lockdown with gateway guard policy#21273
Closed
Replace GitHub MCP server lockdown with gateway guard policy#21273
Conversation
…grity:approved) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 16, 2026 18:47
View session
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
Replaces the GitHub MCP server "lockdown" feature with a guard policy from the gateway that sets
repos: allandmin-integrity: approved. Removes the pre-activation check for a PAT needed to run lockdown since the feature is now supported by the gateway.Changes
Core changes
lockdownfield fromGitHubToolConfigtype, YAML parser, and JSON schemaLockdownandLockdownFromStepfields fromGitHubMCPDockerOptionsandGitHubMCPRemoteOptionsgetGitHubLockdown()andhasGitHubLockdownExplicitlySet()helper functionsgenerateGitHubMCPLockdownDetectionStep()and the lockdown detection step from the compiled outputGITHUB_LOCKDOWN_MODEenv var andX-MCP-Lockdownheader from MCP server renderingGITHUB_MCP_LOCKDOWNenv var from gateway container and environment collectionNew behavior
getEffectiveGitHubGuardPolicies()that returns user-configured guard policies or defaults to{allow-only: {repos: "all", "min-integrity": "approved"}}— applied at the gateway level for all workflows using the GitHub MCP serverrenderGuardPoliciesToml()to support string field values (not just arrays), enabling TOML-format rendering of thereposandmin-integritypolicy fieldsPre-activation check removed
determine_automatic_lockdown.cjs(PAT detection script)validate_lockdown_requirements.cjs(PAT presence validation at runtime)validateLockdownRequirementsfromgenerate_aw_info.cjsWorkflow updates
lockdown:field from 17 workflow.mdfiles in.github/workflows/Security Summary
No new security vulnerabilities introduced. The change replaces a server-side lockdown mechanism with an equivalent gateway-level guard policy (
repos: all,min-integrity: approved). CodeQL found 0 alerts.