github / github/copilot-sdk

Allow trusted host init scripts to preserve direct-script review

Đang mở
#2,466 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
vs-code
Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
128

Mô tả

## Context

VS Code is adopting the public per-session `shell.initScripts` API so the SDK built-in shell tool can load the user's shell profile and activate the workspace-selected Python environment:

https://github.com/microsoft/vscode/pull/332593

## Observed behavior

With no init scripts configured, a direct script invocation can be reviewed using the script and interpreter content under the normal permission flow.

When the same session has any host-provided `shell.initScripts` entry, the direct script invocation instead requires explicit approval because the shell environment can alter the script action.

This is secure as a conservative default, but it means an SDK consumer cannot opt into a known, host-generated activation script without changing approval behavior for otherwise identical direct script commands.

## Ask

Please consider a public SDK contract for trusted host-provided init scripts that preserves safe direct-script review when possible.

Possible shapes include:

- allowing the SDK/runtime to incorporate the exact init-script content into the reviewed action/fingerprint; or
- adding explicit trust metadata for host-generated init scripts, with a conservative default for existing callers.

The behavior must remain secure when init scripts are user-controlled, mutable, unreadable, or otherwise cannot be bound to the reviewed action.

## Consumer requirements

- Per-session and updateable, matching `shell.initScripts`.
- Applies to the built-in shell tool.
- Does not weaken approval for arbitrary or unbound startup scripts.
- Works for Bash and PowerShell host activation scripts.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi luồng phê duyệt và xem xét script trực tiếp của công cụ shell tích hợp, song song với API công khai shell.initScripts theo từng phiên. So sánh cách các script kích hoạt host của Bash và PowerShell được biểu diễn, sau đó xác định cách nội dung chính xác hoặc siêu dữ liệu tin cậy có thể được gắn với hành động đã xem xét mà không làm suy yếu việc xem xét các script do người dùng kiểm soát hoặc không thể đọc; được xem là hoàn thành khi vẫn duy trì việc xem xét an toàn các script trực tiếp đối với những script host được tin cậy rõ ràng và có thể cập nhật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, powershell, python, shell
Lĩnh vực
developer-experience, security, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.