Skip to content

feat(permissions): map copilot.sandbox to VS Code Agent Host sandbox settings - #3514

Merged
dyoshikawa merged 7 commits into
mainfrom
resolve-issue-2401-copilot-upstream
Oct 17, 2026
Merged

dyoshikawa merged 7 commits into
mainfrom
resolve-issue-2401-copilot-upstream

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Implements the sandbox item still open in #2401, against the key shapes VS Code 1.141 settled on for the Agent Host sandbox.

  • New copilot.sandbox permissions override. Each leaf maps to the flat setting chat.agent.sandbox.<path> in .vscode/settings.json:
    • enabled (off / on)
    • network.allowNetwork, network.allowLocalNetwork
    • allowUnsandboxedCommands, mcpServers, lspServers
    • credentials.authenticategit, credentials.authenticategh
    • fileSystem.allowDevToolAccess
    • fileSystem.userConfiguredPaths (readwritePaths / readonlyPaths / deniedPaths)
  • Unknown keys are rejected (strict schema). The deprecated 1.138 keys (chat.agent.sandbox.allowNetwork, .fileSystem.linux|mac|windows) are not modeled, since the Agent Host ignores them.
  • Only the leaves you state are written. Other sandbox keys stay as the file has them. userConfiguredPaths merges per list, so authoring readwritePaths keeps a hand-written deniedPaths.
  • Values that loosen the sandbox (enabled: "off", allowLocalNetwork: true, mcpServers: false, a non-empty readwritePaths, and so on) are written but reported in one warning. This uses the shared sandbox-trust helpers.
  • On import, each managed key with a valid shape is read back into copilot.sandbox.
  • The new keys are added to the .vscode/settings.json ownedKeys declaration. docs/reference/file-formats.md and the embedded docs are updated.

Key names, types and enum values were checked against:

The network.allowedDomains / deniedDomains example on the sandboxing page is not mapped, because VS Code does not register those settings.

Refs #2401

Still open in #2401 (not in this PR)

  • chat.tools.eligibleForAutoApproval (experimental) / chat.tools.global.autoApprove
  • MCP global/portable scope (~/.copilot/mcp-config.json, .mcp.json), which still has a collision design question with copilotcli / claudecode
  • copilot-plugin packaging, REVIEW.md, dictation files
  • Prompt files → skills, and the commandWindows ↔ windows mapping question
  • The stale read premise comment

Test plan

  • New unit tests cover generate, per-key merge, leaving keys alone when the override is absent, the trust warning, strict-key rejection, import, invalid-shape skip and the round trip
  • pnpm cicheck

🤖 Generated with Claude Code

https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv

dyoshikawa and others added 7 commits October 17, 2026 22:06
…settings

Add a `copilot.sandbox` permissions override that writes the
`chat.agent.sandbox.*` settings VS Code 1.141 settled on for the Agent
Host sandbox (enabled, network, unsandboxed commands, MCP/LSP servers,
credentials, file system) to `.vscode/settings.json`. Only stated leaves
are written, `userConfiguredPaths` merges per list, values that loosen
the sandbox are reported in one warning, and import reads the keys back.
The deprecated 1.138 shapes are not modeled.

Refs #2401

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…pilot-upstream

# Conflicts:
#	src/generated/docs-content.ts
…pilot-upstream

# Conflicts:
#	src/generated/docs-content.ts
…pilot-upstream

# Conflicts:
#	src/generated/docs-content.ts
…pilot-upstream

# Conflicts:
#	src/generated/docs-content.ts
…pilot-upstream

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit cacd267 into main Oct 17, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2401-copilot-upstream branch October 17, 2026 15:47
dyoshikawa added a commit that referenced this pull request Oct 17, 2026
…llowups

fix: address low-severity review follow-ups from #3508-#3514
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