Skip to content

Sandbox limits powershell behavior #17019

Open

Description

@acepace

What version of the Codex App are you using (From “About Codex” dialog)?

26.325.31654

What subscription do you have?

Business

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When codex runs terminal commands in the sandbox, it loads the default user powershell profile and runs the commands. Those can frequently fail outside the sandbox. Example

Get-ChildItem -Force

Output is

  Directory: D:\tests\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          07/04/2026    17:38                VPN

fnm: C:\Users\[username redacted]\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:1
Line |
   1 |  fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expressi .
     |  ~~~
     | The term 'fnm' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the
     | spelling of the name, or if a path was included, verify that the path is correct and try again.
Import-Module: C:\Users\[username redacted]\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:36
Line |
  36 |  Import-Module -Name Microsoft.WinGet.CommandNotFound
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What steps can reproduce the bug?

Create a powershell profile under
%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

With a command such as
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression

or
Import-Module -Name Microsoft.WinGet.CommandNotFound

What is the expected behavior?

  1. Codex should recognize there was a failure and stop
  2. Codex should run without the user profile if inside a sandbox

Additional information

No response

Activity

  1. added
    app
    on Apr 7, 2026
  2. added
    bug
    windows-os
    sandbox
    on Apr 7, 2026
  3. removed
    app
    on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions