Repository navigation
agentHost: honor identity capture policy in host telemetry - #339045
Merged
Merged
Conversation
Apply managed identity capture to host metadata and trace storage/export. Preserve existing content-capture and export-destination precedence while resolving the new identity preference against shell environment values. Refs #336814. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Identity filtering currently fails open when payload normalization throws, allowing unredacted data to be forwarded.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Applies governed identity capture to Agent Host-owned OpenTelemetry while preserving existing telemetry and content-capture controls.
Changes:
- Propagates identity policy through Agent Host startup configuration.
- Filters governed identity attributes before storage/export and adds host identity when enabled.
- Adds integration tests and updates monitoring documentation.
| File | Description |
|---|---|
src/vs/platform/agentHost/common/agentService.ts |
Adds identity policy translation. |
src/vs/platform/agentHost/common/agentHostStarter.config.contribution.ts |
Connects the managed policy setting. |
src/vs/platform/agentHost/electron-main/electronAgentHostStarter.ts |
Applies policy to desktop hosts. |
src/vs/platform/agentHost/node/nodeAgentHostStarter.ts |
Applies policy to node hosts. |
src/vs/platform/agentHost/node/agentHostServices.ts |
Passes structured OTel options. |
src/vs/platform/agentHost/node/otel/agentHostOTelService.ts |
Captures and filters identity. |
src/vs/platform/agentHost/OTEL.md |
Documents identity governance. |
extensions/copilot/docs/monitoring/agent_monitoring.md |
Clarifies pipeline separation. |
src/vs/platform/agentHost/test/common/agentService.test.ts |
Tests policy precedence and restart behavior. |
src/vs/platform/agentHost/test/node/agentHostServices.test.ts |
Tests service registration options. |
src/vs/platform/agentHost/test/node/otel/agentHostOTelService.integrationTest.ts |
Tests identity filtering and export. |
src/vs/platform/agentHost/test/node/otel/agentHostTiming.test.ts |
Adapts timing tests to new options. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
roblourens
previously approved these changes
Oct 1, 2026
Contributor
Ross Wollman (rwoll)
marked this pull request as draft
October 1, 2026 05:02
Reject loopback payloads when normalization fails instead of forwarding unredacted bytes. Keep transformation errors out of logs and responses, and tolerate hostname detection failures independently of OS username detection. Add receiver and host-export regression coverage for rejected payloads and hostname lookup failures. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Ross Wollman (rwoll)
marked this pull request as ready for review
October 1, 2026 05:09
Ross Wollman (rwoll)
enabled auto-merge
October 1, 2026 05:09
Alex Ross (alexr00)
approved these changes
Oct 1, 2026
Ross Wollman (rwoll)
added a commit
that referenced
this pull request
Oct 2, 2026
The Local harness is being deprecated in favor of Agent Host, backed by the Copilot SDK. Rollout has started, but some existing VS Code enterprise policies need translation into the SDK's Unified Managed Settings so enterprise controls remain intact during the transition. ## What this PR does - **Enables supported legacy policy conversion by default.** Removes the separate bridge opt-in, `chat.agentHost.copilot.mapLegacySettingsToManagedSettings`. When rollout or explicit selection chooses Copilot Agent Host, supported restrictions carry over automatically. Native terminal restrictions, including global user settings, still require approval under Allow All/assisted approval. - **Adds applied-policy readiness diagnostics.** Run **Developer: Policy Diagnostics** from the Command Palette to see conversion/enforcement coverage, source, impact, and remaining gaps. Separates unsupported requirements from source/path-dependent coverage needing verification; excludes unconfigured policies and preserves existing diagnostic sections. Policy gaps appear in diagnostics but do not block Agent Host rollout. Existing rollout behavior is unchanged, and supported policy restrictions remain enforced. Scope: Copilot Agent Host on this machine, not certification of remote hosts or other providers. Refs #332011, #337536, #337537. ## Accepted gaps (report-only) Accepted for this PR's rollout posture, not reclassified as enforced or treated as individual administrator consent. Source/path-dependent findings may already be enforced by runtime-native settings. OTel is implemented; its entries concern remaining forwarding, precedence, and runtime coverage. Its policies also reference `github.copilot.chat.otel.enabled`, `github.copilot.chat.otel.exporterType`, `github.copilot.chat.otel.captureIdentity`, and `github.copilot.chat.otel.headers`. **Merged fixes:** [#339144](#339144) closes the legacy macOS/Linux `ChatAgentSandboxEnabled: on` gap allowing direct session Off overrides; it is omitted below. Host identity capture is also fixed by [#339045](#339045). Both fixes are merged into `main`; this is not a claim of release availability. Sandbox lifecycle validation remains open: distinguish policy still loading from confirmed withdrawal, and verify loss/reapplication of the last client's requirement across disconnect-grace expiry. The separate sandbox auto-approval gap remains below. | Policy / setting | Remaining impact | |---|---| | `ChatToolsEligibleForAutoApproval` / `chat.tools.eligibleForAutoApproval` | Bypass is disabled for excluded tools, but per-tool confirmation is not guaranteed through other approval paths. | | `ChatToolsTerminalEnableAutoApprove` / `chat.tools.terminal.enableAutoApprove` | Native shell asks are covered; custom-terminal coverage is incomplete (`chat.agentHost.customTerminalTool.enabled`). | | `ChatAgentSandboxAllowAutoApprove` / `chat.agent.sandbox.allowAutoApprove` | Active sandboxed commands may auto-approve without an equivalent blanket shell ask. Activation includes `chat.agent.sandbox.enabledWindows`. | | `ChatMCP` / `chat.mcp.access` | Independent runtime discovery can escape workbench access filtering. | | `ChatAllowedMcpServers` / `chat.mcp.allowedServers`<br>`ChatDeniedMcpServers` / `chat.mcp.deniedServers`<br>`ChatAllowManagedMcpServersOnly` / `chat.mcp.allowManagedServersOnly` | VS Code-only restrictions do not reach every forwarded, discovered, or built-in server path. | | `McpEnterpriseManagedAuthIdp` / `mcp.enterpriseManagedAuth.idp` | Forwarded authentication lacks Local's enterprise IdP lookup; SSO may fail. | | `ChatPluginsEnabled` / `chat.plugins.enabled`<br>`ChatEnabledPlugins` / `chat.plugins.enabledPlugins` | Independent discovery and customization paths can bypass disablement or required-plugin decisions. | | `ChatExtraMarketplaces` / `chat.plugins.extraMarketplaces`<br>`ChatStrictMarketplaces` / `chat.plugins.strictMarketplaces` | Runtime-owned operations lack VS Code-only values; strict lists do not disable installed plugins. | | `ChatStrictPluginOnlyCustomization` / `chat.customizations.strictPluginOnlyCustomization` | Independent discovery, instructions, and selective lockdown lack equivalent coverage. | | `ChatHooks` / `chat.useHooks`<br>`ChatAllowManagedHooksOnly` / `chat.hooks.allowManagedOnly` | The Local switch does not disable runtime file hooks; managed-only file-hook/SDK-callback coverage is incomplete or unverified. | | `ChatAgentMode` / `chat.agent.enabled` | Agent Host targets can remain available when agent mode is disabled. | | `CopilotOtelEnabled` / `chat.agentHost.otel.enabled` | Separate destinations/recorders can override disablement. | | `CopilotOtelProtocol` / `chat.agentHost.otel.exporterType` | Inherited OTLP configuration can override exporter selection. | | `CopilotOtelCaptureIdentity` / `chat.agentHost.otel.captureIdentity` | Host identity capture is fixed ([#339045](#339045)); runtime account attribution awaits upstream merge, a bundled runtime roll, and end-to-end verification. No additional VS Code account-identity wiring is expected. | | `CopilotOtelHeaders` / `chat.agentHost.otel.headers` | Missing host forwarding can break authenticated export. | | `ChatAgentNetworkFilter` / `chat.agent.networkFilter`<br>`ChatAgentAllowedNetworkDomains` / `chat.agent.allowedNetworkDomains`<br>`ChatAgentDeniedNetworkDomains` / `chat.agent.deniedNetworkDomains` | Legacy allowlists are not mandatory boundaries on native runtime URL/shell paths; supported URL denies and shared VS Code filtering remain. Domain `limitTo` integration is accepted follow-up work, not a landing prerequisite. | *🤖 Authored with GitHub Copilot on behalf of @rwoll.*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Admins can already control identity capture for the Local harness. This change applies the same policy to VS Code's own Agent Host telemetry, which is exported separately from the Copilot runtime.
Existing-user impact: identity capture is off by default. Explicitly supplied identity attributes that previously passed through the host are now removed unless capture is enabled.
Settled enterprise policy changes automatically restart the desktop Agent Host. Personal changes require a manual restart. Already stored or exported data is unchanged.
This covers the VS Code-owned pipeline, not every runtime's direct exports, and does not add authenticated account attribution (copilot-agent-runtime#24299). Once the runtime fix lands and is bundled in VS Code, account attribution on runtime-generated spans should flow through automatically when both the runtime and host allow identity capture.
Refs #336814.
🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).