Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/daily-issues-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/discussion-task-miner.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/grumpy-reviewer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/issue-arborist.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/issue-monster.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/issue-triage-agent.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/org-health-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/pr-triage-agent.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/refiner.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/stale-repo-identifier.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/weekly-issue-summary.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/weekly-safe-outputs-spec-review.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/workflow-generator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions pkg/workflow/github_lockdown_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ Test lockdown mode with local GitHub MCP.
`,
expected: []string{
`"type": "stdio"`,
`"entrypointArgs": ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE": "1"`,
`"ghcr.io/github/github-mcp-server:`,
},
notExpected: []string{},
description: "Copilot with local mode and lockdown should render GITHUB_LOCKDOWN_MODE=1",
description: "Copilot with local mode and lockdown should render entrypointArgs with --lockdown-mode and GITHUB_LOCKDOWN_MODE=1",
},
{
name: "copilot engine with lockdown enabled in remote mode",
Expand Down Expand Up @@ -90,13 +91,14 @@ tools:
Test lockdown mode with Claude engine.
`,
expected: []string{
`"entrypointArgs": ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE": "1"`,
`"ghcr.io/github/github-mcp-server:`,
},
notExpected: []string{
`"type": "stdio"`, // Claude doesn't include type field
},
description: "Claude with lockdown should render GITHUB_LOCKDOWN_MODE=1",
description: "Claude with lockdown should render entrypointArgs with --lockdown-mode and GITHUB_LOCKDOWN_MODE=1",
},
{
name: "codex engine with lockdown enabled",
Expand All @@ -116,11 +118,12 @@ tools:
Test lockdown mode with Codex engine.
`,
expected: []string{
`entrypointArgs = ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE" = "1"`,
`ghcr.io/github/github-mcp-server:`,
},
notExpected: []string{},
description: "Codex (TOML) with lockdown should render GITHUB_LOCKDOWN_MODE=1",
description: "Codex (TOML) with lockdown should render entrypointArgs with --lockdown-mode and GITHUB_LOCKDOWN_MODE=1",
},
{
name: "lockdown with read-only both enabled",
Expand All @@ -141,6 +144,7 @@ tools:
Test lockdown and read-only modes together.
`,
expected: []string{
`"entrypointArgs": ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE": "1"`,
`"GITHUB_READ_ONLY": "1"`,
},
Expand Down
3 changes: 3 additions & 0 deletions pkg/workflow/github_lockdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func TestRenderGitHubMCPDockerConfigWithLockdown(t *testing.T) {
},
expected: []string{
`"type": "stdio"`,
`"entrypointArgs": ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE": "1"`,
`"GITHUB_TOOLSETS": "default"`,
`"container": "ghcr.io/github/github-mcp-server:latest"`,
Expand All @@ -146,6 +147,7 @@ func TestRenderGitHubMCPDockerConfigWithLockdown(t *testing.T) {
},
notFound: []string{
`"GITHUB_LOCKDOWN_MODE"`,
`"entrypointArgs"`,
},
},
{
Expand All @@ -160,6 +162,7 @@ func TestRenderGitHubMCPDockerConfigWithLockdown(t *testing.T) {
},
expected: []string{
`"GITHUB_READ_ONLY": "1"`,
`"entrypointArgs": ["stdio", "--lockdown-mode"]`,
`"GITHUB_LOCKDOWN_MODE": "1"`,
`"container": "ghcr.io/github/github-mcp-server:v1.0.0"`,
},
Expand Down
10 changes: 10 additions & 0 deletions pkg/workflow/mcp_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ func (r *MCPConfigRendererUnified) renderGitHubTOML(yaml *strings.Builder, githu
yaml.WriteString("]\n")
}

// Add entrypointArgs for lockdown mode
if lockdown {
yaml.WriteString(" entrypointArgs = [\"stdio\", \"--lockdown-mode\"]\n")
}

// Build environment variables
envVars := make(map[string]string)
envVars["GITHUB_PERSONAL_ACCESS_TOKEN"] = "$GH_AW_GITHUB_TOKEN"
Expand Down Expand Up @@ -729,6 +734,11 @@ func RenderGitHubMCPDockerConfig(yaml *strings.Builder, options GitHubMCPDockerO
// for Copilot (see convert_gateway_config_copilot.sh). This keeps the gateway
// config compatible with the schema which doesn't have the tools field.

// Add entrypointArgs for explicit lockdown mode (not applicable when lockdown is determined at runtime)
if options.Lockdown && !options.LockdownFromStep {
yaml.WriteString(" \"entrypointArgs\": [\"stdio\", \"--lockdown-mode\"],\n")
}

// Add env section for GitHub MCP server environment variables
yaml.WriteString(" \"env\": {\n")

Expand Down
Loading