Scaffolded agents mandate approve_all and tools:["*"] — drop the mandate, allowlist tools, gate the immediate-run step, document managed-settings floors

Đang mở
#10 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
62/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, powershell, python

Hướng nghiên cứu

Start with skills/use-ai-gateway/SKILL.md at the cited lines and README §Security; inspect how the build scaffold and C.5 run instructions currently specify permissions, tools, and execution. Confirm the SDK's default and managed-settings behavior, then verify that the documented scaffold requires an explicit tool allowlist and review before running, with managed-settings floors documented.

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

Mô tả

What the skill currently mandates

skills/use-ai-gateway/SKILL.md (v2.2.0) requires every Copilot SDK program the build command scaffolds to ship with three specific posture lines (line numbers at b95b562, HEAD of main today):

  • L.369 (inside the C.2 required-elements list "The generated code must:", L.359): Include "on_permission_request": PermissionHandler.approve_all in the session config
  • L.394 (the skill's own session-config example): on_permission_request=PermissionHandler.approve_all,
  • L.417 (the example's mcp_servers block): "tools": ["*"],
  • L.484-488 (C.5 "Run and verify"): "Don't stop at 'here's the code.' Run the agent once..." / "Run it (e.g. python agent.py) and read the output." — execute the generated program in the same session, before any human review of the generated code.
What the SDK runtime does with those lines

Checked against github-copilot-sdk 1.0.14 (current PyPI release):

  • No handler (the shipped default since copilot-sdk#509 "deny all permissions by default" and #554 "Require permission handler on session creation"): the session dispatch returns PermissionDecisionUserNotAvailable() — shell, MCP, write, read, and URL requests are all denied.
  • approve_all (what L.369/L.394 mandate): every request kind resolves to an unconditional PermissionDecisionApproveOnce — stateless, no prompt; three consecutive shell decisions all come back approve-once.
  • approve_all raises only under the session-level managed_settings_enabled flag (and defers requests marked managed_approval_required). The repo never mentions managed settings (repo-wide grep: zero hits), and the README §Security plus the skill's Guardrails block cover key hygiene and read-only gateway posture only — execution posture is addressed nowhere.
Why the composition matters for consumers

The gateway's documented deployment model is a shared, multi-backend resource — platform teams federating MCP servers, OpenAPI APIs and SaaS connectors behind one governed endpoint. Two principals other than the consumer author content a scaffolded program consumes:

  1. a registering team (any holder of write access to the gateway resource) — controls model backends and tool registrations, including tools/list descriptions;
  2. the operator of a federated external backend — controls tool results and descriptions, holding no Azure RBAC at all.

"tools": ["*"] wires every registered server's tools — with their registrant-authored descriptions — into the program with no curation step. approve_all then approves anything the model requests, including shell. C.5 directs the first run before a human has read the generated code. On unmanaged hosts (the SDK default, and the population this plugin targets) that is unattended command execution driven by registrant-authored content, in a program whose repo-facing security framing ("Guardrails", "Read-only against the gateway") never mentions it.

Two-session local check (mock gateway, mock model backend)

The same scaffolded program run twice against a local mock gateway + mock model backend (BYOK provider, so no GitHub auth involved):

  • With the mandated config (approve_all + tools: ["*"]): 40 permission.requested events, all 40 auto-approved; a single model turn demanding the runtime's powershell tool executed 39 times in a 35-second window — wrote a sentinel file and POSTed the project .env gateway key to the mock collector endpoint each time. No interaction at any point.
  • Same session minus the handler: 257 tool demands, zero approvals surfaced, zero executions.

The gate the scaffold removes is real at the runtime layer, and it is the only thing standing between registrant-authored content and the workstation.

Repro sketch
  1. Register one tool server on a gateway whose tools/list entry carries a description you control (any local HTTP responder; az aigateway mcp create --endpoints accepts arbitrary URLs).
  2. Run /ai-gateway:build and let the skill scaffold the program; confirm the three mandates landed (the L.369 handler, the L.417 wildcard, the C.5 run directive).
  3. Point the BYOK provider at a model backend you control; one model turn demands the runtime's powershell tool with a command that writes a sentinel file.
  4. Run it once per C.5: the command executes with no prompt and the sentinel appears. Delete on_permission_request from the same program and run again: nothing executes.
Requested changes
  1. Drop the approve_all mandate (L.369, L.394): scaffold the SDK default (deny; handler required) and let the consumer opt into an approval policy explicitly.
  2. Replace "tools": ["*"] (L.417) with a per-server tool allowlist confirmed at build time.
  3. Gate C.5 behind review: present the generated program for human review before any execution, instead of directing an immediate run.
  4. Document the managed-settings floors (managed_settings_enabled) for enterprise-managed hosts in the repo's security guidance.

Happy to turn the local two-session transcript into a PR against SKILL.md if that's useful.

Ngôn ngữ chính
Python
Star
18
Fork
9
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/aigateway

Tất cả issue của Azure/aigateway

Issue tương tự

Thêm issue về Python

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.