Content exclusion incorrectly blocks commands when a child process loads .env
まだ誰も着手していません。
評価
調査の方向性
まず、**/.env を除外する組織ルールを適用した承認済みのコマンドを、issue に記載されている Python アプリケーションと load_dotenv() を使って再現します。子プロセスに対するコンテンツ除外の処理を追跡します。承認済みのアプリケーションが起動し、.env の内容がモデルコンテキストとして Copilot から利用できない状態を保てれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Our organization has the following content-exclusion policy:
"*":
- "**/.env"
The policy should prevent Copilot from reading .env files or using their contents as model context.
However, Copilot CLI also blocks starting an application when the application itself loads .env during normal startup.
For example, our Python application uses load_dotenv() during startup. The application starts successfully when run directly in the terminal, but Copilot CLI refuses to continue when asked to run the same approved command.
The error shown is:
Access denied: "[REDACTED]/.env" is excluded by organization content policy. Do not attempt to access this file.
Copilot does not need to read .env, receive its contents, or include them in model context for the application to start.
Affected version
GitHub Copilot CLI 1.0.83
Steps to reproduce the behavior
- Configure an organization content-exclusion rule for
**/.env. - Create an application that loads
.envinternally during startup, for example usingpython-dotenvandload_dotenv(). - Verify that the application starts successfully when run directly in a terminal.
- Ask Copilot CLI to run the same startup command.
- Approve the command.
- Observe that Copilot CLI refuses to continue because
.envis excluded.
Expected behavior
Copilot CLI should execute the approved command.
Content exclusion should prevent Copilot from reading or using .env contents as model context, but should not prevent an application from loading the file internally as runtime configuration.
Additional context
- OS: macOS 26.6.2
- Architecture: arm64
- Shell: zsh
This began after content exclusions became generally available in Copilot App and CLI on September 2, 2026:
https://github.blog/changelog/2026-09-02-content-exclusions-generally-available-in-copilot-app-and-cli/
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-cli のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4729 ·
-
area:sessions
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4712 ·
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/copilot-cli#4638 ·
-
Expose large_output_file_path on TaskShellProgress so clients can read complete shell-task output オープンarea:tools
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-cli#4630 · コメント 1 件 ·
github/copilot-cli の issue をすべて見る
似ている issue
-
out-of-date
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
CachyOS/CachyOS-PKGBUILDS#1894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
community-scripts/ProxmoxVE#17396 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mattpocock/skills#1099 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Update Vish to 1.1.5 オープンpackage-update
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
oSoWoSo/vOid_Community_repOsitory#144 · コメント 1 件 ·