Repository navigation
Agent Host: apply supported legacy policy restrictions by default - #337108
Ross Wollman (rwoll) wants to merge 4 commits into
Conversation
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]>
|
Validation carried forward unchanged at 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. |
There was a problem hiding this comment.
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.
Supported legacy VS Code restrictions now reach local Agent Host Copilot sessions by default. This removes the experimental
chat.agentHost.copilot.mapLegacySettingsToManagedSettingsopt-in; staletrue/falseentries 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.falserulesThis 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.