Skip to content

Custom sandboxing #4667

Closed as not planned
Closed as not planned

Description

@o1lo01ol1o

What feature would you like to see?

Related to #4665 ; i'd like codex to be able to run a command with a PATH environment that I provide it. Currently, in a nix project, codex seems to be unable to run basic compiler tasks because it cannot enter the nix environment.

Are you interested in implementing this feature?

No response

Additional information

No response

Activity

  1. github-actions commented on Oct 3, 2025

    @github-actions
    Contributor

    Potential duplicates detected:

    Powered by Codex Action

  2. Meowzz95 commented on Oct 4, 2025

    @Meowzz95
  3. o1lo01ol1o commented on Oct 4, 2025

    @o1lo01ol1o
    Author

    @Meowzz95 No, my issue is that nix-shell or the equivalent will load a shell with all my tools for the given project. if I launch codex, codex does not have access to that shell. Codex is not allowed to invoke that shell and, though nix is fast all things considered, it should not reload the shell every time it needs to check the compiler output.

    the shell policy should default to all but apparently codex does not take the ambient PATH at execution because it doesn't have any of the tools, including nix-shell:

    • Ran cabal test tests
      └ Error: cabal: Could not resolve dependencies:
        [__0] trying: foo-0.1 (user goal)
        … +7 lines
        goals I've had most trouble fulfilling: base, snap-stream, foo
    
    • Ran nix-shell --command 'cabal test tests'
      └ bash: line 1: nix-shell: command not found
    
    > nix-shell isn’t available in this environment (command not found), so the combined command can’t run. If you have Nix installed elsewhere, you could
      invoke the same command there; otherwise we’ll need another way to get the right GHC/base version.
    

    This policy might be able to do something if I could populate it from the given path during the nix shell evaluation:

    [shell_environment_policy]
    inherit = "all"
    set = { PATH = "$NIX_SHELL_PATH" }

    But that's already a bit more janky then just passing through the PATH to codex

  4. etraut-openai commented on Dec 18, 2025

    @etraut-openai
    Contributor

    This feature request hasn't received any upvotes or additional posts in over two months, so I'm going to close it out.

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

    enhancementNew feature or requestsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions