Conversation
Hillary Mutisya (hillary-mutisya)
approved these changes
Sep 25, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jebrans
force-pushed
the
dev/jebransyed/31000000728707-powershell-containment
branch
from
September 27, 2026 02:52
3fe64e5 to
6cd4398
Compare
jebrans
enabled auto-merge
September 27, 2026 06:25
jebrans
disabled auto-merge
September 27, 2026 06:25
Preserve explicit false overrides, reject non-YAML opt-ins and invalid configuration, and enforce the dynamic execution gate at the final runner boundary.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jebrans
enabled auto-merge
September 27, 2026 07:07
jebrans
disabled auto-merge
September 27, 2026 08:13
jebrans
enabled auto-merge
September 27, 2026 08:14
Route untrusted scripts through a fail-closed Windows AppContainer and Job Object broker, constrain the PowerShell language and commands, sanitize the environment, package architecture-specific broker binaries, and add exploit regressions.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use per-execution AppContainer profiles and a cancellation pipe instead of a global broker lock so parallel workers remain isolated without timing out.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run the PowerShell package tests in-band and use production-like broker timeouts so Windows CI does not starve concurrent AppContainer processes.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the monorepo Windows test fan-out on fast unit coverage and run the AppContainer integration suite in the isolated Release broker job, while preserving full local coverage.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the request-path contract rather than mutable runspace state when reporting untrusted broker failures, avoiding dependency on removed PowerShell commands.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep host-side reporting and output cmdlets available while AST validation continues to prevent attacker scripts from invoking unapproved commands.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid mutating InitialSessionState for untrusted scripts, enforce the command boundary through positive AST validation, and reject user-defined functions and types that could shadow approved commands.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose internal host initialization details only in the dedicated CI lane so Windows runner-specific failures can be diagnosed without changing production error disclosure.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass the diagnostics switch on the fixed broker command line so request-file and host initialization failures are visible in the isolated CI lane without exposing production details.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Stop treating command-table mutation as a boundary for reviewed static actions while untrusted scripts remain constrained by AppContainer, CLM, and positive AST validation.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Construct the untrusted runspace variable entry through the framework API so the broker can initialize on Windows images where outer-host utility cmdlets are unavailable.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Summary
powershell.dynamicExecution.enabled: trueandpowershell.brokerExecution.enabled: truebefore any generated, imported, edited, seeded, or manually stored script can run.Security boundary
Dynamic script text no longer reaches the legacy FullLanguage host directly. The TypeScript runner sends a bounded JSON request over stdin to an architecture-specific broker. The broker:
PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES;ACTIVE_PROCESS_LIMIT=1,DIE_ON_UNHANDLED_EXCEPTION, andKILL_ON_JOB_CLOSE;The brokered host rejects type expressions, unsafe type conversions, member invocation, redirection, invocation operators, dynamic commands,
usingstatements, module requirements, andForEach-Objectmember-invocation parameter sets. It accepts only a small server-defined command set for data transformation and output.Capability policy
Dynamic PowerShell currently receives no external filesystem, module, network, executable, service, registry, COM, or child-process capability. Model-authored
allowedModules,networkAccess, and path grants are no longer accepted as authority. Requests containing unsupported commands or capabilities fail with a non-retryable policy denial.This intentionally means custom file/network/process PowerShell flows remain unavailable. Reviewed built-in actions such as
listFilesremain available through their separate static registry. Additional dynamic capabilities require future broker-mediated implementations and security review; they must not be added by widening the model-authored policy.Original incident validation
With both opt-in gates enabled:
[System.IO.File]::ReadAllTextcase is denied and returns no file contents.ForEach-Object -MemberNameand positional member invocation are denied.using moduleand#requires -Modulesare denied.Packaging
win-x64andwin-arm64.Validation
pnpm run build packages/agents/powershellpnpm --filter @typeagent/powershell-typeagent test(79 tests)pnpm --filter @typeagent/config test(199 tests)pnpm run prettier:changed:fixRollback
Turning either execution gate off disables dynamic PowerShell. There is no fallback from brokered dynamic execution to the legacy host. Reviewed static actions remain available independently.