Skip to content

agentHost: add opt-in local credential delegation for Mission Control - #340387

Merged
roblourens merged 2 commits into
mainfrom
roblou/agents/mission-control-local-credentials
Oct 8, 2026
Merged

roblourens merged 2 commits into
mainfrom
roblou/agents/mission-control-local-credentials

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

Add an explicit host-owner opt-in to use the desktop GitHub credential for Copilot authentication from Mission Control clients.

The dedicated iOS GitHub App credential currently receives only legacy, picker-disabled models from CAPI in the observed reproduction. That yields an empty Copilot model catalogue and blocks useful mobile testing. This override permits testing with the owner's already-working desktop credential without changing the normal client-token path.

"chat.agentHost.experimentalMissionControl.useLocalCredentials": true
  • The setting is unregistered, default-off, and available in built products including Insiders. It reads only explicit local User/application values; workspace, workspace-folder, remote-user, and default values cannot enable it.
  • The mobile credential is still required, sealed, purpose/resource checked, and validated directly with GitHub against the registered owner. Supplied connection bindings retain their existing checks.
  • For the exact GitHub Copilot protected resource, the host also validates its current local credential against the same owner and forwards that credential internally. Mobile scopes and expiry are not attached to the local token.
  • Repository-specific and MCP authentication are unchanged. No local credential is returned to the client or published on the relay.
  • Setting or credential changes close prior relay lanes. Withdrawal and stale asynchronous validation are fenced; unavailable, rejected, foreign-owner, or concurrently changed local credentials fail explicitly.

Security Boundary

This is an intentional testing exception to the normal user-local credential sponsorship/control-plane separation contract, not a transparent credential fallback or a managed-sandbox principal.

Remote work can use the desktop credential's broader GitHub permissions. Providers sharing the Copilot protected resource can receive it, and SDK agent work may use it beyond inference. Existing remote-control policy, workspace grants, and tool permissions remain in force. The shared provider credential store's retention/sponsorship limitations are unchanged.

The host logs a warning when the override is enabled, and the operation/security docs describe the exception. No new setting schema, enterprise policy, or remote configuration surface is added.

This PR does not include the separate local relay-tracing/model diagnostics or the iOS model-picker fix tracked in github/mobile-ios#26865.

Validation

  • npm run build-fast -- --client-only — passed for this standalone PR.
  • npm run typecheck-client — passed.
  • npm run eslint -- src/vs/platform/agentHost/common/agentService.ts src/vs/platform/agentHost/node/missionControl/missionControlAuthentication.ts src/vs/platform/agentHost/node/missionControl/missionControlEnvironment.ts src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.ts src/vs/platform/agentHost/test/node/missionControlAuthentication.test.ts src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlContribution.test.ts — passed.
  • ./scripts/test.sh --reporter dot --run src/vs/platform/agentHost/test/node/missionControlAuthentication.test.ts --run src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts --run src/vs/platform/agentHost/test/node/missionControlHost.test.ts --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlContribution.test.ts --run src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts --grep 'Mission Control|relay|Relay|negotiates 0.9.0' — 153 tests passed.
  • git diff --check — passed.

Coverage includes default behavior, both sealing algorithms, local-only configuration in Insiders, owner checks, missing/rejected credentials, unchanged repository/MCP tokens, binding, local-token rotation, in-flight mode changes, withdrawal, and internal-only protocol-handler forwarding.

A prior full development build with the workaround was launched successfully; local delegation was enabled and Mission Control reported the environment online. Successful mobile inference with the override and packaged-product validation have not been confirmed.

Manual Testing

  1. Launch a host build containing this change and sign in to GitHub.
  2. Enable Mission Control and set the unregistered override above in local User settings.
  3. Wait for registration readiness and the local-delegation warning.
  4. Reconnect from iOS with the same GitHub account and select a model belonging to the conversation's agent.
  5. Verify Copilot work uses the local credential. Set the override to false or remove it, reconnect, and verify normal client credentials are restored.

(Written by Copilot)

Allow an unregistered local-user opt-in in real builds to delegate the desktop credential for the exact Copilot protected resource. Validate remote and local owners, preserve MCP/repository authentication, and fence mode changes, rotation and withdrawal.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:00

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.

🔵 Needs a closer look

Credential delegation crosses a sensitive security boundary, and packaged-product/mobile inference remains unvalidated.

0 open findings

What changed in this PR

Adds an opt-in Mission Control path that delegates same-owner Copilot authentication to the desktop GitHub credential while preserving remote credential validation.

Changes:

  • Adds the unregistered local-only opt-in and propagates it through Agent Host configuration.
  • Validates both remote and desktop credentials and fences credential/mode changes.
  • Adds security documentation and extensive authentication/lifecycle tests.
File Description
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​remoteAgentHost.contribution.ts Reads the opt-in and configures delegation.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​missionControlContribution.test.ts Tests setting scope and reconfiguration.
src/​vs/​platform/​agentHost/​common/​agentService.ts Extends Mission Control options.
src/​vs/​platform/​agentHost/​node/​missionControl/​missionControlEnvironment.ts Propagates mode and credential changes.
src/​vs/​platform/​agentHost/​node/​missionControl/​missionControlAuthentication.ts Validates and substitutes the local credential.
src/​vs/​platform/​agentHost/​node/​missionControl/​MISSION_CONTROL.md Documents operation and risks.
src/​vs/​platform/​agentHost/​node/​missionControl/​MISSION_CONTROL_SECURITY_REQUIREMENTS.md Records the security exception.
src/​vs/​platform/​agentHost/​test/​node/​missionControlAuthentication.test.ts Covers credential validation and fencing.
src/​vs/​platform/​agentHost/​test/​node/​missionControlProtocolServer.test.ts Covers lane lifecycle and mode changes.
src/​vs/​platform/​agentHost/​test/​node/​protocolServerHandler.test.ts Verifies internal-only forwarding.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@roblourens
roblourens marked this pull request as ready for review October 7, 2026 23:07
@roblourens
roblourens enabled auto-merge (squash) October 7, 2026 23:07
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: f21d032f Current: 6e164679

Changed (1)

sessions/chatCompositeBar/MixedStatuses/Light
Before After
before after

@roblourens
roblourens merged commit 79510e0 into main Oct 8, 2026
35 checks passed
@roblourens
roblourens deleted the roblou/agents/mission-control-local-credentials branch October 8, 2026 00:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 8, 2026
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