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

Abierto
#10 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
azure, powershell, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
18
Forks
9
Merge medio
1 d 16 h
PR fusionados (30 d)
23

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/aigateway

Todos los issues de Azure/aigateway

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.