Skip to content

feat(copilot): model sandbox credentials.envVars and warn on ignored edit rules - #3940

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2401-copilot-2026-11-19
Nov 22, 2026
Merged

dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2401-copilot-2026-11-19

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follows up on the 2026-11-19 upstream re-check in #2401 for the copilot permissions adapter.

  • copilot.sandbox.credentials.envVars: VS Code 1.146 added chat.agent.sandbox.credentials.envVars, a map from an environment variable name to { "injectHosts": [...] }. It is registered without a scope (workspace-settable, restricted: true) in [email protected]. Before this change, authoring it failed the whole permissions load with Unrecognized key: "envVars". It is now accepted (strict { injectHosts: string[] } values), written to the flat key, declared in the shared-config gateway's owned keys, read back on import (an invalid shape is skipped), and a non-empty map triggers the existing sandbox trust warning, since it lets the sandbox send the values to the listed hosts.
  • Ignored edit rules: chat.tools.edits.autoApprove is registered with scope: ConfigurationScope.APPLICATION in [email protected], so VS Code ignores it in .vscode/settings.json. Generate now warns when the canonical config produces edit rules. The key is still written so the file round-trips and output stays the same for existing users; whether to stop emitting it is left to the maintainer.
  • Docs: docs/reference/file-formats.md now says workspace terminal/URL approvals are honored only by the Local harness (per the approvals docs; the Local harness is removed in February 2027), documents credentials.envVars, and explains why the network domain lists are not modeled.

Still open in #2401

  • Network domain settings (chat.agent.sandbox.network.allowedDomains / deniedDomains, chat.agent.networkFilter): all three are ConfigurationScope.APPLICATION (user-only) in 1.147.0, so writing them to the workspace would be ignored. They need a user-scope permissions surface, which is a design decision (VS Code's user settings.json is outside rulesync's home-relative global model).
  • User-scope approvals surface, stopping edit emission, and the urgency-raised items (prompt files → skills, portable MCP destinations / global scope) — maintainer decisions.
  • Older open items listed in the issue are unchanged.

Refs #2401

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 3 commits November 22, 2026 17:49
…edit rules

- Accept `copilot.sandbox.credentials.envVars` (VS Code 1.146+), write it to
  `chat.agent.sandbox.credentials.envVars`, read it back on import, and warn
  when a non-empty map lets the sandbox send values to the listed hosts.
- Warn when canonical `edit` rules are generated: VS Code registers
  `chat.tools.edits.autoApprove` with application scope and ignores it in
  `.vscode/settings.json`.
- Document that workspace terminal/URL approvals only apply to the Local
  harness, and that the network domain lists are user-only settings.

Refs #2401

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…dcard hosts

- The `sandbox.credentials.envVars` trust warning now lists each
  `VAR -> injectHosts` pair (JSON-quoted).
- An `injectHosts` entry containing `*` gets a separate, stronger warning.
- Tests for keeping/replacing a hand-written envVars, an empty envVars, and
  the edits warning with a `*` deny or an `edit: {}` retraction.

Refs #2401

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…pilot-2026-11-19

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit b6bbac9 into main Nov 22, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2401-copilot-2026-11-19 branch November 22, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant