Content exclusion incorrectly blocks commands when a child process loads .env
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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/
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lệnh đã được phê duyệt với quy tắc của tổ chức loại trừ **/.env, sử dụng ứng dụng Python và load_dotenv() được mô tả trong issue. Theo dõi cách xử lý việc loại trừ nội dung đối với các tiến trình con; được xem là hoàn tất khi ứng dụng đã được phê duyệt khởi động trong khi nội dung của .env vẫn không thể được Copilot sử dụng làm ngữ cảnh mô hình.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli, security
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100