Skip to content

Add Agent Host PowerShell nested script-block auto-approval regressions - #329290

Merged
Anthony Kim (anthonykim1) merged 2 commits into
mainfrom
anthonykim1/powershell-nested-autoapprove-regressions
Aug 6, 2026
Merged

Add Agent Host PowerShell nested script-block auto-approval regressions#329290
Anthony Kim (anthonykim1) merged 2 commits into
mainfrom
anthonykim1/powershell-nested-autoapprove-regressions

Conversation

@anthonykim1

Copy link
Copy Markdown
Contributor

Part of: #328133

  • Add Agent Host PowerShell regressions for nested commands inside Measure-Command and related script-block wrappers.
  • Keep an outer allow rule from hiding nested denied cmdlets such as Set-Content, Invoke-Expression, and Start-Process.
  • Cover the visible-separator control path and show that selecting the Bash grammar can still make the same rules opaque.
  • Add a session-permission proof that PowerShell script-block payloads with nested denials require confirmation, including when shell language is missing.

Inspirations from:

Cover Measure-Command and related wrapper shapes so nested denied commands
inside PowerShell script blocks cannot be auto-approved when the PowerShell
grammar is selected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 102bf1fe-34f3-4b81-b22f-5677ace2be4d
Copilot AI balanced review requested due to automatic review settings August 5, 2026 23:15
@anthonykim1
Anthony Kim (anthonykim1) marked this pull request as ready for review August 5, 2026 23:17
@anthonykim1 Anthony Kim (anthonykim1) added this to the 1.133.0 milestone Aug 5, 2026
@anthonykim1
Anthony Kim (anthonykim1) enabled auto-merge (squash) August 5, 2026 23:17

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

Adds regression coverage for PowerShell nested script-block auto-approval behavior.

Changes:

  • Tests nested denied cmdlets and incorrect Bash grammar selection.
  • Verifies session permissions fail closed for nested denials and missing dialects.
Show a summary per file
File Description
commandAutoApprover.test.ts Adds parser-level PowerShell regressions.
sessionPermissions.test.ts Adds session-level confirmation regressions.

Review details

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

Comment thread src/vs/platform/agentHost/test/node/commandAutoApprover.test.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@anthonykim1
Anthony Kim (anthonykim1) merged commit 3cad839 into main Aug 6, 2026
29 checks passed
@anthonykim1
Anthony Kim (anthonykim1) deleted the anthonykim1/powershell-nested-autoapprove-regressions branch August 6, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants