Description
Describe the bug
Environment variables available in the PowerShell process that launches Copilot are not visible to Copilot's shell command runner. This prevents commands and integrations launched by the runner from using user-configured environment variables such as GITHUB_PERSONAL_ACCESS_TOKEN.
Affected version
Copilot CLI 1.0.105
Steps to reproduce the behavior
-
On Windows, store
GITHUB_PERSONAL_ACCESS_TOKENin the User environment-variable scope. -
Open a new PowerShell 7 prompt.
-
Load the User-scope value into the current process and verify it without printing the secret:
$env:GITHUB_PERSONAL_ACCESS_TOKEN = [Environment]::GetEnvironmentVariable('GITHUB_PERSONAL_ACCESS_TOKEN', 'User') $env:GITHUB_PERSONAL_ACCESS_TOKEN -ne $null
This returns
True. -
Launch Copilot CLI from that same PowerShell prompt.
-
In the Copilot session, run:
! $env:GITHUB_PERSONAL_ACCESS_TOKEN -ne $nullThis returns
False. -
The runner reports the following scope state without exposing the secret value:
Process: False User: True Machine: False
The behavior reproduces in a newly opened PowerShell prompt and a newly launched Copilot session. No token value was printed or included in this report.
Expected behavior
The shell command runner should inherit the environment of the Copilot process that was launched from PowerShell, or the behavior should be clearly documented if credential variables are intentionally filtered.
Additional context
- Operating system: Windows
- Shell: PowerShell 7
- The runner and launcher are running under the same Windows account; account/domain details are intentionally omitted.
- The issue appears specific to the Copilot command-runner process boundary. It may be intentional credential sanitization, but this is not documented and prevents expected environment-based authentication for child commands.
Activity
Omzig commentedon Oct 28, 2026
Workaround on every new session shell call:
$env:GITHUB_PERSONAL_ACCESS_TOKEN = [Environment]::GetEnvironmentVariable('GITHUB_PERSONAL_ACCESS_TOKEN', 'User')