Skip to content

AHP: opt into SDK managed-settings self-fetch#323651

Draft
joshspicer wants to merge 1 commit into
mainfrom
agents/managed-settings-ahp-opt-in
Draft

AHP: opt into SDK managed-settings self-fetch#323651
joshspicer wants to merge 1 commit into
mainfrom
agents/managed-settings-ahp-opt-in

Conversation

@joshspicer

@joshspicer joshspicer commented Jun 30, 2026

Copy link
Copy Markdown
Member

AHP: opt into SDK managed-settings self-fetch

The Agent Host (AHP) Copilot session launcher now passes selfFetchManagedSettings: true when creating a Copilot SDK session, so the runtime self-fetches and enforces enterprise managed settings (bypass-permissions policy) using the session's GitHub token — without VS Code having to implement the enforcement itself.

Change

  • src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts — set selfFetchManagedSettings: true in _buildSessionConfig. The runtime calls /copilot_internal/managed_settings + device MDM and enforces the result fail-closed before the first turn.

The flag is typed via the SDK's SessionConfigBase (see the SDK PR below); no enforcement logic lives in VS Code.

Validation

Verified end-to-end: AHP-spawned Copilot sessions self-fetched the enterprise server policy (disableBypassPermissionsMode: "disable") and disabled bypass-permissions mode (bypassDisabled=true) across 3/3 sessions; /allow-all is rejected by runtime policy.

Related PRs


⚠️ Draft — part of a 3-repo change (runtime + SDK + VS Code).

Pass selfFetchManagedSettings:true in session.create params so the
runtime self-fetches enterprise bypass-permissions policy from the
GitHub managed_settings endpoint at session bootstrap. The runtime
enforces the result fail-closed before the first turn.

Requires: github/copilot-agent-runtime#agents/managed-settings-sdk-capability
Copilot AI review requested due to automatic review settings June 30, 2026 01:19

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.

Pull request overview

This PR updates the Agent Host (AHP) Copilot session launcher to opt Copilot SDK sessions into runtime-managed enterprise policy enforcement by enabling the SDK/session flag for self-fetching managed settings at bootstrap time.

Changes:

  • Enable selfFetchManagedSettings: true in the session config built by CopilotSessionLauncher.
  • Document (in-code) that the runtime will self-fetch managed settings and enforce them before the first turn.
Show a summary per file
File Description
src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts Adds selfFetchManagedSettings: true to the SDK session config built during session launch.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +413 to +417
// Opt the runtime into self-fetching enterprise managed settings
// (bypass-permissions policy) at session bootstrap. The runtime uses
// the session's gitHubToken to call /copilot_internal/managed_settings
// and enforces the result fail-closed before the first turn.
// Declared in copilotSdkAugmentation.d.ts pending SDK type update.
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.

2 participants