Skip to content

agentHost: honor identity capture policy in host telemetry - #339045

Merged
Ross Wollman (rwoll) merged 4 commits into
mainfrom
rwoll/otel-identity-1e415032
Oct 1, 2026
Merged

Ross Wollman (rwoll) merged 4 commits into
mainfrom
rwoll/otel-identity-1e415032

Conversation

@rwoll

Copy link
Copy Markdown
Member

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.

  • Identity disabled: omit governed identity fields before host storage and export.
  • Identity enabled: include the OS username and hostname in host-generated telemetry, and preserve provider-supplied identity.
  • Enterprise policy wins over personal configuration and inherited environment variables. Enabling identity capture does not enable telemetry or content capture.

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).

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]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 04:36
Reviewed-head: 9b2d899
Pull-request: #339045
Approved-by: rwoll via PR Sign-Off
Requested-by: otel-identity

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.

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 High severity · 1 Medium severity

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
roblourens previously approved these changes Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: dc546cc3 Current: 0991c6f9

Changed (2)

sessions/accountMenu/WeeklyAndFiveHourLimits/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

@rwoll
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]>
Reviewed-head: daf2d17
Pull-request: #339045
Approved-by: rwoll via PR Sign-Off
Requested-by: otel-identity
@rwoll
Ross Wollman (rwoll) merged commit 5877034 into main Oct 1, 2026
35 checks passed
@rwoll
Ross Wollman (rwoll) deleted the rwoll/otel-identity-1e415032 branch October 1, 2026 08:52
@vs-code-engineering vs-code-engineering Bot added this to the 1.141.0 milestone 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.*
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants