Skip to content

Remove redundant safe-inputs env vars from MCP server config#8263

Merged
pelikhan merged 3 commits intomainfrom
copilot/remove-gh-token-config
Dec 31, 2025
Merged

Remove redundant safe-inputs env vars from MCP server config#8263
pelikhan merged 3 commits intomainfrom
copilot/remove-gh-token-config

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Safe-inputs environment variables (e.g., GH_AW_GH_TOKEN, GH_DEBUG) were being declared twice: once in the step's env block and again in the MCP server config's env object. Since safe-inputs uses HTTP transport, the agent process already has access to step-level environment variables.

Changes

  • pkg/workflow/safe_inputs_renderer.go: Modified renderSafeInputsMCPConfigWithOptions to only include server configuration variables (GH_AW_SAFE_INPUTS_PORT, GH_AW_SAFE_INPUTS_API_KEY) in the MCP config's env block
  • Removed collection and passthrough of tool-specific environment variables from the MCP configuration
  • Updated 5 lock files to reflect the cleaner configuration

Before/After

Before:

"env": {
  "GH_AW_SAFE_INPUTS_PORT": "\${GH_AW_SAFE_INPUTS_PORT}",
  "GH_AW_SAFE_INPUTS_API_KEY": "\${GH_AW_SAFE_INPUTS_API_KEY}",
  "GH_AW_GH_TOKEN": "\${GH_AW_GH_TOKEN}",
  "GH_DEBUG": "\${GH_DEBUG}"
}

After:

"env": {
  "GH_AW_SAFE_INPUTS_PORT": "\${GH_AW_SAFE_INPUTS_PORT}",
  "GH_AW_SAFE_INPUTS_API_KEY": "\${GH_AW_SAFE_INPUTS_API_KEY}"
}

Tool-specific environment variables remain in the step's env block where they're accessible to the agent process.

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/user
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE 0.1-go1.25.0.linGOMODCACHE GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 0.1-go1.25.0.linGOMODCACHE GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v6 -buildtags /usr/bin/git -errorsas -ifaceassert 4547505563965291/tmp/validate-js-702397727.cjs git -c ithub/workflows log (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login ithub/workflows go /usr/bin/git -json GO111MODULE 0.1-go1.25.0.lin--json git -C oad-artifact.git oad-artifact.git /usr/bin/gh l GO111MODULE 0.1-go1.25.0.linuser gh (http block)

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

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20613677455/job/59202530656#step:16:1

Thé env variables of safe inputs are already configured in the start step and do not need to be added to the MCP server.config

E.g.: remove

    "GH_AW_GH_TOKEN": "${GH_AW_GH_TOKEN}",

✨ 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 December 31, 2025 07:09
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] Remove GH_AW_GH_TOKEN from MCP server.config Remove redundant safe-inputs env vars from MCP server config Dec 31, 2025
Copilot AI requested a review from pelikhan December 31, 2025 07:22
@pelikhan pelikhan marked this pull request as ready for review December 31, 2025 07:30
@pelikhan pelikhan merged commit 150e5fd into main Dec 31, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/remove-gh-token-config branch December 31, 2025 07:30
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.

2 participants