Skip to content

fix: enforce MCP gateway tool allowlist and restrict config file permissions#22931

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/mcp-gateway-tool-allowlist-enforcement
Closed

fix: enforce MCP gateway tool allowlist and restrict config file permissions#22931
Copilot wants to merge 3 commits intomainfrom
copilot/mcp-gateway-tool-allowlist-enforcement

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

****** in MCP config files (mode 0644) could be read by any process on the runner and used to call arbitrary gateway tools, bypassing --allowed-tools constraints that were only enforced at the Claude client layer.

Changes

File permission hardening

All config files containing gateway bearer tokens now get 0600 permissions:

  • start_mcp_gateway.sh: Uses install -m 0600 /dev/null to pre-create gateway-output.json before the redirect — atomic, no race window
  • Converter scripts (claude, copilot, codex, gemini): chmod 0600 on their respective output files

Tools field propagation (gateway-layer enforcement)

  • mcp_config_custom.go: Changed condition for including the tools field from RequiresCopilotFields || len(mcpConfig.Allowed) > 0 to Format == "json" — the field is now always emitted in JSON-format gateway INPUT configs for all engines, defaulting to ["*"] when no restriction is declared
  • convert_gateway_config_claude.sh and convert_gateway_config_gemini.sh: Replaced del(.tools) with (if .tools then . else . + {"tools": ["*"]} end) — the declared tool scope is now mirrored in the client config instead of being stripped

Previously, Claude/Gemini workflows with allowed: ["read_file"] would produce an mcp-servers.json with no tools restriction at all; now the scope is preserved end-to-end so the gateway can enforce it.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD erignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE kktofgkkiBW8 env -json GO111MODULE a38e0292b58e7a5e-d GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name --show-toplevel git ache/uv/0.11.1/x86_64/node --show-toplevel git /usr/bin/git git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha graphql -f /usr/bin/git -f owner=github -f git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha ache/go/1.25.0/x--show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel go /usr/bin/gh node js/f�� me: String!) { --show-toplevel gh /opt/hostedtoolcache/node/24.14.0/x64/bin/node /repos/github/ghgit --jq /usr/bin/git node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha /bin/sh git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel /bin/sh /usr/bin/git node js/f�� 0/x64/bin/node git /opt/pipx_bin/bash --show-toplevel git /usr/bin/git bash (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE er: String!, $name: String!) { repository(owner: $owner, name:-f GOINSECURE GOMOD GOMODCACHE git rev-�� k/gh-aw/gh-aw/.github/workflows GOPROXY /usr/bin/git l GOWORK 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel go /usr/bin/git git cjs --show-toplevel git ache/node/24.14.0/x64/bin/node --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git ache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha GOMODCACHE go /usr/bin/git -json GO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE repository(owne--show-toplevel git rev-�� --show-toplevel go /usr/bin/git ithub/workflows GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha xterm-color go /usr/bin/docker -json GO111MODULE 64/bin/go docker imag�� inspect mcp/notion /usr/bin/git prettier --check 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha graphql -f /usr/bin/infocmp -f owner=github -f infocmp -1 xterm-color sh /usr/bin/git "prettier" --chegit sh 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git -json GO111MODULE repository(owne--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha xterm-color go /home/REDACTED/work/_temp/uv-python-dir/node -json GO111MODULE 64/bin/go node /opt�� view @sentry/mcp-server@0.29.0 /usr/bin/infocmp --check **/*.cjs $name) { has--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha xterm-color node /usr/bin/git run lint:cjs 64/bin/go git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config /usr/bin/gh remote.origin.urgit sh 64/bin/go /usr/bin/gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /usr/bin/git npx prettier --cgit GOPROXY 64/bin/go git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config /usr/bin/git remote.origin.urgit sh 64/bin/go git (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config /usr/bin/infocmp remote.origin.urgit lint:cjs DiscussionsEnabl--show-toplevel infocmp -1 xterm-color sh /usr/bin/git "prettier" --chegit sh 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/checkout/git/ref/tags/v5 --jq /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel go /usr/bin/git node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git node (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha xterm-color /bin/sh /usr/bin/git cd actions/setupgit GOPROXY 64/bin/go git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config /usr/bin/infocmp remote.origin.urgit sh $name) { has--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel go 64/bin/node node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git node (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha xterm-color bash 0/x64/bin/node --noprofile go /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel /opt/hostedtoolc--package-lock-only 0/x64/bin/node /opt/hostedtoolcgit git /usr/bin/git git arne�� --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh -c npx prettier --cGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go sh (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility /tmp/go-build4151504272/b421/_pkGOINSECURE -trimpath 64/bin/go -p github.com/githuapi -lang=go1.25 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh -c npx prettier --cGOSUMDB GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/n/home/REDACTED/work/gh-aw/gh-aw/.github/workflows sh (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config /opt/hostedtoolcache/go/1.25.0/x64/bin/node remote.origin.urgit GO111MODULE DiscussionsEnabl--show-toplevel node /opt�� view @sentry/mcp-server@0.29.0 /usr/bin/infocmp --check **/*.cjs 64/bin/go infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel go 86_64/node node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel gh /usr/bin/git node js/f�� /usr/lib/git-cor--show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel /usr/lib/git-correv-parse /usr/bin/git node (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha ithub/workflows GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE me: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD ed } } go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel /tmp/go-build3021650281/b001/workflow.test 0/x64/bin/node -test.paniconexigit -test.timeout=10rev-parse /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git arne�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE er: String!, $name: String!) { repository(owne-f GOINSECURE GOMOD GOMODCACHE go env ithub/workflows GO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link 0/x64/bin/node /tmp/go-build302git -importcfg /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel -extld=gcc /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git arne�� --show-toplevel git de/node/bin/bash --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 node /usr/bin/tr x_amd64/cgo git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260325-180929-46124/test-706191014 tr [:up�� [:lower:] node /usr/bin/git 0/x64/bin/node git /opt/hostedtoolcuser.email git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 node /usr/bin/git /usr/bin/cut git /opt/hostedtoolc--show-toplevel git stat�� /usr/bin/git node /usr/bin/git 0/x64/bin/node git /usr/bin/bash git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 node /usr/bin/mkdir /usr/bin/wc git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260325-180929-46124/test-706191014 mkdir -p /tmp/gh-aw node /usr/bin/git 0/x64/bin/node git /usr/bin/tail git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 node /usr/bin/sed /usr/bin/git git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260325-180929-46124/test-706191014 sed s|[/�� /usr/bin/git node /usr/bin/git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 node /usr/bin/sed x_amd64/vet git 044101/b123/vet.HEAD sed s/^-�� /usr/bin/git node /usr/bin/git /php.ini git '~E_ALL' git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 fVF4L3zKJzfxZ/DXZrgNxz_Q5IbWl0mFUT/cTUsh3waIZM6Nw5zwnxy/tx521QjfVF4L3zKJzfxZ /usr/bin/sed ry=1 git che/go-build/88/.github/workflows/test.md sed s/-\�� /usr/bin/git node /usr/bin/git 0/x64/bin/node git /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 node /usr/bin/sed x_amd64/vet git 044101/b375/vet.--git-dir sed s/-$�� /usr/bin/git node /usr/bin/git 0/x64/bin/node git /tmp/go-build171--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --show-toplevel git bin/node --show-toplevel git /usr/bin/git git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git tags/v5 git k/_temp/uv-pytho--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 git 471171/b375/vet.--git-dir git rev-�� --show-toplevel node er: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabl--show-toplevel 0/x64/bin/node git /tmp/go-build874--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE r: $owner, name:-f GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel go bin/node k/gh-aw/gh-aw/.gnode GO111MODULE me: String!) { repository(owne--show-toplevel git ache�� --show-toplevel nly /usr/bin/git --noprofile GOPROXY er: String!, $name: String!) { --show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -aw-actions/git/ref/tags/v0.1.2 git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/infocmp --show-toplevel git ache/go/1.25.0/x/tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_only_defaults_repo2719694348/001 infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.--noprofile git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git cal/bin/bash git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.--noprofile git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git rgo/bin/bash git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git k/_temp/ghcca-no/tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_with_explicit_repo2903270515/001 git (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha vYnA/esbrzjp-J9uGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 1504272/b403/imprev-parse /hom�� che/go-build/b2/GOSUMDB **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti/home/REDACTED/work/gh-aw/gh-aw/.github/workflows go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel go ache/node/24.14.0/x64/bin/node ithub/workflows GO111MODULE n-dir/bash git ache�� --show-toplevel nly /usr/bin/git k/gh-aw/gh-aw/.gnode GOPROXY (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /v1.0.0 git ache/node/24.14.0/x64/bin/node git (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion /usr/bin/git git /opt/hostedtoolc--show-toplevel git rev-�� HEAD node 0/x64/bin/node 0/x64/bin/node git /usr/bin/infocmp--show-toplevel git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build1734952146/b001/cli.test /tmp/go-build1734952146/b001/cli.test -test.testlogfile=/tmp/go-build1734952146/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s rev-�� --show-toplevel git k/_temp/uv-python-dir/node --show-toplevel git 64/pkg/tool/linux_amd64/vet git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel git ache/go/1.25.0/x64/bin/node --show-toplevel git /usr/bin/git git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 25, 2026 18:11
…issions

- Restrict mcp-servers.json, mcp-config.json, config.toml, settings.json and
  gateway-output.json to 0600 to protect the bearer token from token theft
- Preserve the 'tools' field in Claude and Gemini converter scripts instead
  of stripping it, so the declared tool scope is mirrored in client configs
- Always include the 'tools' field in JSON-format gateway INPUT configs for
  all engines (not only Copilot), defaulting to [\"*\"] when no restriction is
  declared; this allows the MCP gateway to enforce the tool allowlist at the
  gateway layer rather than only at the Claude client layer
- Update affected tests to reflect the new behavior where Claude/Gemini
  configs always include a 'tools' field"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a6f42d81-d98f-47a1-be42-dd0e5c368173
…ve test robustness

- Use install -m 0600 to pre-create gateway-output.json with restricted permissions
  before the background redirect, eliminating the race between file creation and chmod
- Replace fragile whitespace-specific assertion with a cleaner check in
  TestRenderCustomToolWithoutGuardPoliciesJSON

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a6f42d81-d98f-47a1-be42-dd0e5c368173
Copilot AI changed the title [WIP] Fix MCP gateway to enforce tool allowlist at the gateway layer fix: enforce MCP gateway tool allowlist and restrict config file permissions Mar 25, 2026
Copilot AI requested a review from pelikhan March 25, 2026 18:16
@pelikhan pelikhan requested a review from lpcox March 25, 2026 18:24
@pelikhan pelikhan closed this Mar 25, 2026
@github-actions github-actions bot deleted the copilot/mcp-gateway-tool-allowlist-enforcement branch April 2, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP gateway should enforce tool allowlist at the gateway layer, not only at the Claude client layer

2 participants