Add Agent Host PowerShell nested script-block auto-approval regressions - #329290
Merged
Anthony Kim (anthonykim1) merged 2 commits intoAug 6, 2026
Merged
Conversation
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
Anthony Kim (anthonykim1)
marked this pull request as ready for review
August 5, 2026 23:17
Anthony Kim (anthonykim1)
enabled auto-merge (squash)
August 5, 2026 23:17
Contributor
There was a problem hiding this comment.
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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 5, 2026
roblourens
approved these changes
Aug 5, 2026
Anthony Kim (anthonykim1)
deleted the
anthonykim1/powershell-nested-autoapprove-regressions
branch
August 6, 2026 00:13
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of: #328133
Measure-Commandand related script-block wrappers.Set-Content,Invoke-Expression, andStart-Process.Inspirations from:
denies commands nested inside script blockstest.CommandAutoApproverlanguage handling and the PowerShell capture query in_extractSubCommands.SessionPermissionManager.getAutoApproval.