Skip to content

Conversation

@zhao-oai
Copy link
Collaborator

@zhao-oai zhao-oai commented Nov 21, 2025

allowing cmds greenlit by execpolicy to bypass sandbox + minor refactor for a world where we have execpolicy rules with specific sandbox requirements

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 103 to 107
let mut initial_sandbox = self
.sandbox
.select_initial(&turn_ctx.sandbox_policy, tool.sandbox_preference());
if tool.wants_escalated_first_attempt(req) {
if tool.should_bypass_sandbox_first_attempt(req) {
initial_sandbox = crate::exec::SandboxType::None;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor sandbox policy for policy-approved commands

The new ApprovalRequirement::Skip { bypass_sandbox: true } returned for Decision::Allow (see exec_policy.rs lines 95‑112) now causes ToolOrchestrator::run to overwrite the sandbox selected from the user's SandboxPolicy and run with SandboxType::None whenever a command is policy-approved. For non-DangerFullAccess policies such as ReadOnly or WorkspaceWrite, earlier runs would stay inside the platform sandbox, but after this change those commands execute completely unsandboxed with no extra approval, effectively ignoring the configured sandbox restrictions.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is intended

@zhao-oai zhao-oai requested a review from bolinfest November 21, 2025 19:35
@zhao-oai zhao-oai merged commit 87b2117 into main Nov 21, 2025
44 of 46 checks passed
@zhao-oai zhao-oai deleted the dev/zhao/bypass-policyapproved-cmds branch November 21, 2025 23:03
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants