Allow managed policy to pre-approve and require extensions from managed plugins (needed for prompt blocking)

Aberta
#5,575 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
30/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
github, javascript
Domínio
cli, security

Direção de pesquisa

Start by tracing how managed enabledPlugins settings, extension permission approvals, and extension loading are handled in Copilot CLI; the issue names no source files or tests. Compare those paths with the managed policy hook behavior referenced in the report. Done means managed plugins can enforce their extensions under the requested policy, with coverage for approval, experimental mode, and user disable settings.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

area:enterprise area:permissions area:plugins
Summary

Organizations can require a plugin through managed settings (enabledPlugins), but they cannot make an extension shipped inside that plugin run without user interaction. This matters for prompt-policy use cases: only programmatic SDK hooks (extensions) can return decision: "block" from onUserPromptSubmitted. Command and HTTP config-file hooks have their userPromptSubmitted output dropped, so they can only audit prompts.

As a result, there is currently no way for an administrator to enforce prompt blocking on managed devices.

Environment
  • Copilot CLI 1.0.115, macOS arm64
  • VS Code 1.147 (Agent Host, bundled @github/copilot-sdk)
What we observed

Test setup: a plugin installed from a marketplace with "extensions": "./extensions" in plugin.json. Its extension registers onUserPromptSubmitted and returns { decision: "block", reason } for matching prompts.

  1. Blocking works in both Copilot CLI and VS Code once the extension is running: no model turn runs and no user message is recorded.
  2. The extension asks for user approval. The extension-permission-access request is for the register hooks capability. In -p mode it is denied (denied-no-approval-rule-and-could-not-request-from-user).
  3. A saved approval only applies to the exact folder. An entry in permissions-config.json keyed by a parent folder, $HOME, / or * does not apply to subfolders.
  4. There is no managed way to pre-approve it. The MDM managed-settings keys don't cover extension approvals. Managed permissions.allow only supports Shell, Read, Edit and Domain.
  5. CLI extensions require experimental mode. Copilot CLI only loads extensions with --experimental or experimental: true, and experimental is not a supported managed key. VS Code enables experimental mode in its Agent Host.
  6. Users can disable the extension. Setting extensions.disabledExtensions or extensions.mode: "disabled" in the user's settings disables it, even when its plugin is required by managed policy. This was verified in both Copilot CLI and VS Code.
  7. --allow-all approves the extension, but that is a per-user choice and is unavailable when disableBypassPermissionsMode is set.
Requested behavior

For plugins required by managed policy (enabledPlugins in MDM, server-managed, or managed-settings.json):

  • Their extensions should be treated as approved, or there should be a managed setting to pre-approve extension-permission-access for specific plugin extensions.
  • Their extensions should load without experimental mode, or administrators should be able to set it through managed settings.
  • Users should not be able to turn those extensions off through extensions.disabledExtensions or extensions.mode. This would mirror how managed policy hooks keep running when disableAllHooks is set.

Alternatively, letting command/HTTP userPromptSubmitted hooks from managed policy or managed plugins return decision: "block" would also cover this use case without requiring extensions.

Related
  • #4640: prompt hooks were skipped for messages sent while the agent is working (fixed in 1.0.115).
Linguagem predominante
Python
Estrelas
11.5k
Forks
2k
Merge médio
6h 34min
PRs com merge (30d)
3

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/copilot-cli

Todas as issues de github/copilot-cli

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.