-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add codex-rs --dangerously-run-with-no-sandbox #1307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add codex-rs --dangerously-run-with-no-sandbox #1307
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Given that this fails for me today:
I don't think this quite accomplishes the goal (or at least, I'm not sure it matches user expectations). It's a little tricky because the are two dimensions to "permissiveness" that can be configured independently:
Note the latter is determined by codex/codex-rs/core/src/exec.rs Lines 65 to 74 in b73426c
To that end, I don't know if For reference, my personal
In other words, this already satisfies the case where I don't want to be prompted for anything, but I do want it everything to be run under a sandbox policy that is roughly equivalent to |
Ok, I renamed the option to |
I just went to check where we decide what variant of codex/codex-rs/core/src/safety.rs Lines 85 to 103 in b73426c
where codex/codex-rs/core/src/protocol.rs Lines 249 to 254 in b73426c
so I see how your The thing that I don't love about this is that the relationship between this two codepaths is not completely obvious, so I'm worried it makes it too easy to change one in a way that inadvertently breaks I'm looking now to see if there's an easy way to make this relationship more straightforward. |
#1248 is somewhat related in that I am not 100% happy with the contract I implemented for |
@cliff-openai though given this investigation, would using the following config unblock you for the moment?
Though assuming this works, this feels like a bug because it should be possible to use this in concert with |
@@ -176,6 +176,18 @@ impl SandboxPolicy { | |||
} | |||
} | |||
|
|||
/// Unrestricted policy: allow full disk read/write and network access. | |||
/// Commands will be auto-approved without sandbox enforcement. | |||
pub fn new_unrestricted_policy() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will still end up invoking Landlock/Seccomp on linux. In the actual exec.rs
code I think we want a conditional to just straight up not sandbox at all to achieve the properties you're looking for here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think that the current version now does this (more explicitly has a "NoSandbox" implementation)
This option is now explicitly just about sandbox policy, and we are explicit/clear about the "NoSandbox" state.
ok, I've updated the change to be more explicitly just about creating a "no sandbox" option. I am not blocked, and am happy to just abandon this change if it is not helpful. I was assuming that the presence of issue #1254 meant that this change was wanted, but no worries if not. |
This should address #1254 (and motivation/justification is available there)
In short, the sandbox, even with network+disk access, still blocks some things on osx (like access to the keychain most likely). Also, in some environments people are already fully sandboxed (externally to codex), so this gives an option in those environments.