copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Feature: enterprise/org server-managed settings (incl. `env`) for the local Copilot CLI

Open velimattiv opened this issue 5 months ago • 4 comments

Problem

Org admins have no way to centrally push configuration — especially environment variables — to developers' local Copilot CLI installs. Today the only org-managed env mechanism is Agents/Codespaces secrets, which only reach GitHub-hosted cloud environments. For the local CLI (incl. VS Code dev containers on Colima/Lima/Podman), the only options are MDM-placed files or per-host provisioning — neither of which reaches into an unmanaged container.

Request

A server-delivered, org/enterprise-managed settings layer for the local Copilot CLI — fetched at auth and refreshed periodically, taking precedence over user/repo settings — that can set a managed env block, e.g.:

// org-managed settings (delivered over the network, not a local file)
{ "env": { "MY_ORG_CONFIG_VALUE": "…" } }

These vars would apply to CLI sessions (and ideally subprocesses/plugin hooks), so org-distributed plugins/tools can pick up required config with no MDM and no per-machine provisioning.

Why existing mechanisms don't cover it

  • Agents/Codespaces secrets → cloud agent / Codespaces only; never reach the local CLI.
  • Org/enterprise policies (#1971) → governance (enable/disable, model & MCP allowlists), not arbitrary config/secret delivery.
  • .env loading (#2879) → local files the developer manages, not org-pushed.

Prior art

Claude Code ships exactly this as server-managed settings (admin console → delivered at auth, refreshed hourly, reaches inside containers, supports an env block) — see code.claude.com/docs server-managed-settings. Enterprise-managed models already landed for Copilot CLI (#3730), so an enterprise-managed settings/env layer is a natural extension. Would also complement the Claude-parity work in #2471.

velimattiv avatar Jun 24 '26 11:06 velimattiv

Hey @velimattiv, I'd love to hear more about what specific settings you want to manage for an enterprise/org server side? We have plugins support in server side enterprise managed settings today, and are working through a long list of settings to bring to this, so hearing your concrete asks would help us prioritize here!

https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/configure-enterprise-plugin-standards

meagancojocar avatar Jun 24 '26 22:06 meagancojocar

Thanks @meagancojocar!

To be concrete: the gap for us isn't marketplace/auto-install governance (enabledPlugins etc., which work well) - it's a way for an enterprise/org admin to deliver an arbitrary env var / config key-value to the plugin process at runtime (an env block), not just allow/deny lists.

Use case: we distribute a private, org-internal plugin via the enterprise marketplace; it forwards OTel telemetry to Azure Monitor Logs (Log Analytics) via the Logs Ingestion API. At startup it needs one rotating, org-issued value - a low-sensitivity bootstrap value whose only job is to mark that enrollment came from a legitimately distributed org plugin within an enterprise (it establishes provenance, not access to anything sensitive). That bootstrap gates enrollment with our service, which in turn lets the plugin mint the short-lived Azure Monitor bearer (from our org endpoint) that the Logs Ingestion API requires. We'd rather not have it baked into the published artifact: that pins it (no rotation without a republish), drops it into source control, and ties one published plugin to a single org. We do have an MCP OAuth pathway already for the sensitive parts, but an org bootstrap prior to user-initiated authenticated actions reduces friction.

Ask: an env (or pluginConfig) block in managed-settings.json, org/enterprise-scoped, delivered at auth and refreshed, reaching the local CLI - including inside dev containers, since auth-based delivery is the only channel that reaches ephemeral per-project containers without per-host provisioning (our deployment model; device-management/MDM doesn't reach there). Per-team/group scoping of those values would be a bonus for staged rollout.

velimattiv avatar Jun 25 '26 22:06 velimattiv

I see this as two things:

First: being able to set e.g. OTEL_EXPORTER_OTLP_ENDPOINT (or any env variable) in the settings.json file like so:

{
  "env": {
    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317"
  }
}

This would be preferable for me rather than trying to use dotfiles, .*shrc, or ~/.config/environment.d/copilot.conf to achieve the same thing. And Claude Code supports this currently.

Second: Being able to deploy that setting with the Enterprise-managed settings, which would also allow rolling this out for all of an enterprise's Copilot users.

ScriptSmith avatar Jun 29 '26 08:06 ScriptSmith

@meagancojocar, a concrete case since you asked. Ours sits a bit differently from @velimattiv's: we publish to a public marketplace instead of distributing internally. For an internal plugin, baking the value into the artifact is merely undesirable. For a published one it can't work at all, because one artifact serves every customer and the values are per-customer.

dash0-agent-plugin exports OpenTelemetry traces from coding-agent sessions. Same plugin across Claude Code, Copilot CLI, Cursor, and Codex. Its hooks need an OTLP endpoint and an ingest token at runtime.

On Claude Code an admin can push those to a whole fleet and developers do nothing, because the plugin declares a userConfig schema in plugin.json and managed settings fill it in:

{
  "enabledPlugins": { "dash0-agent-plugin@dash0": true },
  "pluginConfigs": {
    "dash0-agent-plugin@dash0": {
      "options": { "OTLP_URL": "https://ingress.example.com", "AUTH_TOKEN": "…" }
    }
  }
}

Copilot CLI has enabledPlugins and extraKnownMarketplaces, and those work well. Neither half of the config channel exists though: there's no userConfig field in plugin.json, and no per-plugin config key in managed-settings.json. So a managed rollout gets the plugin installed and stops there. Every developer still hand-writes ~/.copilot/dash0-agent-plugin.local.md.

On shape, we'd rather see scoped per-plugin config than a general env block, for the reason you gave in the 2026-07-08 managed OTel release:

For security, managed exporter headers are applied only to the Copilot Chat extension's OTLP exporter and are never passed through environment variables, so a value such as an authentication token can't leak into the tool subprocesses that the agent host spawns.

A managed env block hands that exposure straight back. Scoping values to the plugin that declared them reuses the model you already shipped there.

Separately, and probably cheaper to build: our Copilot integration reads Copilot's own native OTel through COPILOT_OTEL_FILE_EXPORTER_PATH. An admin has no way to turn that on, so today we ask each developer to paste a shell function into their profile that shadows copilot. If the managed telemetry block could switch on the file exporter, and it already carries captureContent, that shell function disappears without needing the general env mechanism.

One dependency either way: #4283. A server-managed enabledPlugins: true installs the plugin but persists enabled: false, so its hooks never load on later starts. Hooks are our entire integration surface.

Glad to test a preview against a real deployment.

nicolastakashi avatar Jul 31 '26 09:07 nicolastakashi