#9101·jan

bug: Windows sandbox still fails with os error 203 after #9042, including with system PowerShell

Author: artem-salchuk-eduCreated Sep 29, 2026Updated Sep 29, 2026

Version: 0.8.4-5172 (Nightly)

Describe the Bug

On Windows, every shell command in Cowork fails before the shell process starts with:

ERROR: sandbox setup failed: could not start C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe inside the sandbox: The system could not find the environment option that was entered. (os error 203) The sandbox could not build an environment for the shell, which is a bug in Jan rather than a problem with the shell's location; please report it with the app logs.

The same error originally occurred with the default Git Bash shell:

C:\Program Files\Git\bin\bash.exe

I then explicitly set:

JAN_AGENT_SHELL=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

The environment variable was confirmed both at User scope and in a new PowerShell process:

[Environment]::GetEnvironmentVariable("JAN_AGENT_SHELL", "User") $env:JAN_AGENT_SHELL

Both returned:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

After fully restarting Jan, Jan correctly attempted to start the system PowerShell executable, but the same os error 203 occurred.

This suggests the issue is not Git Bash permissions or shell discovery. The failure appears to happen while Jan is creating the AppContainer child environment, before the selected shell actually starts.

File tools such as read, write, and edit work normally in the Cowork workspace. The failure appears isolated to shell execution inside the Windows sandbox.

Related issues / fixes:

  • #9041
  • #9042
  • #9044

Steps to Reproduce

  1. Run Jan Nightly 0.8.4-5172 on Windows x86_64.
  2. Open Cowork and attach a workspace folder.
  3. Ask the agent to run any shell command, for example: whoami or: Get-Location
  4. Observe os error 203.
  5. Set JAN_AGENT_SHELL to the system PowerShell executable: [Environment]::SetEnvironmentVariable( "JAN_AGENT_SHELL", "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", "User" )
  6. Fully close Jan and start it again.
  7. Run another shell command.
  8. Jan now attempts to start system PowerShell, but the same os error 203 occurs.

Screenshots / Logs

app.log

The error shown by Jan is: ERROR: sandbox setup failed: could not start C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe inside the sandbox: The system could not find the environment option that was entered. (os error 203) The sandbox could not build an environment for the shell, which is a bug in Jan rather than a problem with the shell's location; please report it with the app logs.

Operating System

  • MacOS
  • Windows
  • Linux