Skip to content

agentHost: allow sandbox changes when managed policy permits bypass - #341671

Merged
Dileep Yavanmandha (dileepyavan) merged 5 commits into
microsoft:mainfrom
dileepyavan:sandbox_bypass
Oct 15, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 5 commits into
microsoft:mainfrom
dileepyavan:sandbox_bypass

Conversation

@dileepyavan

@dileepyavan Dileep Yavanmandha (dileepyavan) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #341677

Allow session sandbox changes when managed policy permits bypass.

If the runtime rejects a change, restore the last applied state and update the collapsed control to show it.

Tests passed: typecheck, build, lint, 180 picker tests, and 1,173 runtime tests.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 02:36
@dileepyavan Dileep Yavanmandha (dileepyavan) changed the title agentHost: handle managed sandbox bypass failures agentHost: allow sandbox changes when managed policy permits bypass Oct 15, 2026

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.

🟡 Changes recommended

Automatic rollback synchronization defeats selection preservation, and a nested regression test does not execute.

2 open findings
What changed in this PR

Moves managed sandbox opt-out to the session toggle, with runtime approval and rejection handling.

Changes:

  • Uses session commands for managed sandbox changes; permission prompts approve individual requests only.
  • Restores applied settings after rejection and updates picker state handling.
  • Updates sandbox documentation and regression tests.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostSandboxNotification.test.ts Updates managed bypass notification expectations.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatInputPicker.test.ts Updates toggle policy expectations.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostChatInputPicker.ts Handles failed changes in picker presentation.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​permissionPicker.test.ts Tests editable bypass and collapsed state.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​permissionPicker.ts Consumes sandbox failure state.
src/​vs/​sessions/​contrib/​providers/​agentHost/​test/​browser/​agentHost/​agentHostPermissionPickerDelegate.test.ts Adds failure-state coverage.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​baseAgentHostSessionsProvider.ts Exposes and signals sandbox errors.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​agentHostPermissionPickerDelegate.ts Publishes observable failure state.
src/​vs/​sessions/​common/​agentHostSessionsProvider.ts Adds sandbox error query.
src/​vs/​platform/​agentHost/​test/​node/​sessionSandbox.test.ts Tests rollback and confirmation choices.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Tests runtime commands and rejection handling.
src/​vs/​platform/​agentHost/​test/​browser/​agentHostSandboxToggle.test.ts Tests toggle selection preservation.
src/​vs/​platform/​agentHost/​node/​sessionPermissions.ts Makes sandbox confirmations one-time approvals.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionSandbox.ts Implements session commands and rejection reporting.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Propagates explicit policy conflicts.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Integrates sandbox configuration handling.
src/​vs/​platform/​agentHost/​node/​agentConfigurationService.ts Preserves pending user selections.
src/​vs/​platform/​agentHost/​common/​agent.ts Removes request-bound opt-out capability.
src/​vs/​platform/​agentHost/​browser/​agentHostSandboxToggle.ts Separates requested and applied presentation.
src/​vs/​platform/​agentHost/​AGENTS.md Documents revised sandbox behavior.

🧠 Review effort: Balanced


💡 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Host sandbox toggle is locked when managed policy permits bypass

4 participants