Skip to content

Add staff-only preview setting for /security-review secret detection - #348068

Merged
Bhavya U (bhavyaus) merged 1 commit into
mainfrom
bhavyaus/security-review-secret-detection
Nov 13, 2026
Merged

Bhavya U (bhavyaus) merged 1 commit into
mainfrom
bhavyaus/security-review-secret-detection

Conversation

@bhavyaus

@bhavyaus Bhavya U (bhavyaus) commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a preview setting that lets internal users turn on the Copilot runtime's secret detection model in /security-review. The model finds unstructured credentials, such as plain-text passwords that have no recognizable token format.

What changed

  • New setting chat.copilot.securityReview.secretDetection.enabled, tagged preview and off by default. It is registered only for internal accounts, so other users never see it.
  • Session launch: Copilot SDK sessions always send SECURITY_REVIEW_FINE_TUNED_MODEL as an explicit boolean on create and resume, so nothing outside this setting can turn the feature on.
  • Internal-account check in the agent host: the flag is true only when the setting is on and the session's own account resolves as internal; if that lookup fails, it is false. Root config is shared across windows and can be edited through host settings, so the workbench forwards only the setting and the organization's preview-features policy, as LocalMemory does.
  • Tool allow-list: adds the runtime built-in submit_security_review_scope. The runtime registers it only for the security-review subagent and only when the flag is on, so the main session's tool list and the prompt baselines don't change. copilotBuiltinToolAllowlist.integrationTest.ts lists it under NOT_EXERCISED.

Validation

  • copilotSessionLauncher.test.ts, copilotAgent.test.ts, agentHostCopilotCliSettingsContribution.test.ts and copilotBuiltinToolAllowlist.integrationTest.ts pass. The new launcher test fails without the agent host check.
  • In Code OSS, the setting shows with the Preview tag for an internal account, and the security-review subagent calls submit_security_review_scope.

Follow-ups

  • Remove the internal-account checks when the feature opens more broadly.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 05:19
Adds `chat.copilot.securityReview.secretDetection.enabled` (preview, off by
default), registered only for internal accounts. When on, Copilot SDK
sessions send the runtime's `SECURITY_REVIEW_FINE_TUNED_MODEL` feature flag
on create and resume.

- The flag is always sent as an explicit boolean.
- The agent host sends `true` only when the session's own account resolves as
  internal, and fails closed. The workbench forwards the setting and the
  organization's preview-features policy.
- Allows the runtime's `submit_security_review_scope` built-in, which the
  runtime registers only for the security-review subagent when the flag is on.

Co-authored-by: Copilot <[email protected]>

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

Critical authorization gaps allow settings to bypass the session account’s preview policy and leave the fine-tuned model enabled after credentials switch to an external account.

2 open issues
What changed in this PR

Adds an off-by-default, staff-only preview setting for detecting unstructured credentials during /security-review in Copilot SDK sessions.

Changes:

  • Registers the setting for internal accounts and forwards the opt-in subject to the workbench’s preview policy.
  • Sends an explicit runtime flag on session creation and resume, gated by an internal-account lookup.
  • Allows the security-review scope-submission tool and updates configuration and launch tests.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostCopilotCliSettingsContribution.test.ts Tests setting forwarding and preview-policy changes.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Registers and removes the setting based on internal-account status.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostCopilotCliSettingsContribution.ts Forwards the policy-filtered opt-in to host configuration.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotBuiltinToolAllowlist.integrationTest.ts Records the subagent-only tool as unexercised.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncherTestHelpers.ts Supplies the launcher’s new API-service dependency.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Tests account gating and updates explicit-flag expectations.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Updates expected session feature flags.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Checks internal status and sets the runtime flag explicitly.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotBuiltinToolAllowlist.ts Allows submit_security_review_scope.
src/​vs/​platform/​agentHost/​common/​copilotCliConfig.ts Defines the setting identifier and default-disabled host schema.

Review effort: Balanced

@bhavyaus
Bhavya U (bhavyaus) merged commit fbf43ce into main Nov 13, 2026
93 of 96 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the bhavyaus/security-review-secret-detection branch November 13, 2026 06:35
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 13, 2026
Anthony Kim (anthonykim1) added a commit that referenced this pull request Nov 13, 2026
Resolve the conflict in chat.shared.contribution.ts by importing both
CopilotSecurityReviewSecretDetectionEnabledSettingId from main (#348068)
and AgentHostCopilotShellAuthenticationEnabledSettingId from this branch.
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