Skip to content

Agent Host: apply supported legacy policy restrictions by default - #337108

Closed
Ross Wollman (rwoll) wants to merge 4 commits into
mainfrom
rwoll-legacy-bridge-graduation-pr333290
Closed

Ross Wollman (rwoll) wants to merge 4 commits into
mainfrom
rwoll-legacy-bridge-graduation-pr333290

Conversation

@rwoll

@rwoll Ross Wollman (rwoll) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Supported legacy VS Code restrictions now reach local Agent Host Copilot sessions by default. This removes the experimental chat.agentHost.copilot.mapLegacySettingsToManagedSettings opt-in; stale true/false entries are ignored and cannot disable a mapped restriction. Existing host permission enforcement remains in place. The Local harness, remote hosts, and other agents are unchanged.

Legacy control Before (bridge off) After (this PR)
Global auto-approve disabled by policy Allow All blocked Allow All blocked, also enforced in the runtime
Terminal auto-approve off / false rules Enforced only when the host layer handles the approval Also enforced in the runtime; matching commands require approval
Network deny list, or filter on with empty lists Not enforced for fetch/URL requests Matching domains denied
Network allowlist Not enforced Not enforced; unlisted domains prompt instead of being blocked
Tools ineligible for auto-approval Not enforced; Allow All approves them Allow All disabled for the session (coarser than Local); assisted approval can still approve them
MCP allow/deny Not enforced Unchanged; tracked in #333291
Remote hosts, Claude, Codex Not covered Unchanged

This is not full Local → Agent Host policy parity; MCP, network allowlist, and per-tool approval remain separate work.

Validation: A new bundled-runtime integration test covers no restriction, a denied domain, and a terminal ask across new session, cold resume, and removal, checking that unrelated requests keep baseline approval behavior. Added coverage for deferring the managed-permission restart until an active turn ends; unit tests updated for the removed gate. CI passes at 8c6df6e.

Supersedes #333290. Refs #332011; the first released default-on build remains an open criterion.

joshspicer and others added 4 commits August 31, 2026 11:22
The bridge from legacy VS Code settings to the Copilot SDK's per-session
managedSettings.permissions shipped behind the experimental opt-in
chat.agentHost.copilot.mapLegacySettingsToManagedSettings because the runtime
treated any managed rule from any source as activating the global managed
policy, so one narrow restriction forced unmatched shell/read/write/URL/factory
requests to prompt.

github/copilot-agent-runtime#16249 makes client/session-injected managed
permissions non-activating, which removes that broadening. The bundled runtime
VS Code spawns contains the fix, so the bridge becomes the default enforcement
path.

The setting is deprecated and its value is now ignored rather than honored as an
opt-out: the mappings only ever contribute administrator-configured
restrictions, so honoring an explicit false would let a user switch off an
enterprise policy.

Also drops the now-inert opt-in fixture from the per-tool auto-approval tests
added in #333264, so no test implies the gate still influences the result.

Refs #332011

Co-authored-by: Copilot <[email protected]>
Follow-up to the gate graduation, from PR review:

- The managed-settings skill guidance still listed the false-by-default
  experimental gate as a bridge invariant, which would instruct future work to
  restore the removed gate. Updated in sdk-runtime-policy.md, and in the two
  further places carrying the same claim (legacy-permission-policy.md and
  SKILL.md).
- The protocol-boundary tests still supplied the deprecated opt-in to their
  forwarding fixtures, so they did not prove a local connection forwards
  restrictions without it. Removed, along with the now-unused import.

Co-authored-by: Copilot <[email protected]>
The bridge is now unconditional, so the gating setting had no effect while
still presenting a checkbox in Settings whose description claimed mapping
happens "when enabled". A user with an existing `false` value was told the
bridge was disabled while restrictions were in fact enforced.

Remove the setting from the configuration registry and drop the now-unused
constant. The resolver already ignores the value, so behaviour is unchanged;
this only stops Settings from advertising a control that does nothing.

The unit test keeps the regression guard using the raw setting id, so a stale
settings.json entry still cannot switch off an administrator restriction.

Co-authored-by: Copilot <[email protected]>
Resolve bridge graduation conflicts without reverting newer configuration features. Remove stale opt-in fixtures and verify real bundled runtime restrictions on create, cold resume, and removal, with active-turn lifecycle coverage.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 21, 2026 18:22
@rwoll

Copy link
Copy Markdown
Member Author

Validation carried forward unchanged at 8c6df6e7acfbc2d98269d466cda504d2e9e6596e: the bundled-runtime suite passed all 4 tests (three policy scenarios plus registry guard), 110 focused unit tests passed, and typecheck/lint passed. Native runtime evidence covers no restriction, a lone denied domain, and a lone terminal ask on fresh creation, cold resume, and removal. No code or test changes were made to replace the PR.

Limits: factory behavior is unvalidated; full-AHP setup and policy export are blocked by native dependencies. A broader unit selection had 163 passes, 1 pending, and 3 SQLite-loading failures. Windows/Linux scenario execution and replacement-PR CI are not established by those local results. Detailed commands and evidence remain in #333290.

This head needs renewed review and the user’s trusted signed empty approval checkpoint; no signed approval is claimed. Auto-merge was not enabled on this replacement. The released-build criterion in #332011 remains open.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Default-on security enforcement depends on bundled-runtime behavior and still requires human review plus pending cross-platform validation.

Review effort: Balanced
Findings: None

What changed in this PR

Makes the legacy VS Code restriction bridge default-on for local Copilot Agent Host sessions.

Changes:

  • Removes the obsolete experimental opt-in.
  • Adds runtime coverage for creation, cold resume, removal, and deferred restart behavior.
  • Updates policy guidance to describe unconditional bridging.
File Description
chat.shared.contribution.ts Removes the compatibility setting registration.
agentHostManagedSettings.ts Applies mappings unconditionally.
agentHostManagedSettings.test.ts Updates bridge and stale-setting tests.
agentHostProtocolClient.test.ts Verifies automatic forwarding and clearing.
copilotAgent.test.ts Tests active-turn restart deferral.
copilotManagedPermissions.integrationTest.ts Exercises bundled-runtime permission behavior.
SKILL.md Updates contributor policy guidance.
sdk-runtime-policy.md Documents unconditional bridging and runtime coverage.
legacy-permission-policy.md Documents retirement of the adoption gate.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

4 participants