Skip to content

Auto-approve DangerFullAccess patches on non-sandboxed platforms - #2988

Merged
bolinfest merged 2 commits into
openai:mainfrom
Sing303:codex/update-assess_patch_safety-logic
Sep 3, 2025
Merged

bolinfest merged 2 commits into
openai:mainfrom
Sing303:codex/update-assess_patch_safety-logic

Conversation

@Sing303

@Sing303 Sing303 commented Aug 31, 2025

Copy link
Copy Markdown
Contributor

What?
Auto-approve patches when SandboxPolicy::DangerFullAccess is enabled on platforms without sandbox support.
Changes in codex-rs/core/src/safety.rs: return SafetyCheck::AutoApprove { sandbox_type: SandboxType::None } when no sandbox is available and DangerFullAccess is set.

Why?
On platforms lacking sandbox support, requiring explicit user approval despite DangerFullAccess being explicitly enabled adds friction without additional safety. This aligns behavior with the stated policy intent.

How?
Extend assess_patch_safety match:

  • If get_platform_sandbox() returns Some, keep AutoApprove { sandbox_type }.
  • If None and SandboxPolicy::DangerFullAccess, return AutoApprove { SandboxType::None }.
  • Otherwise, fall back to AskUser.

Tests

  • Local checks:
    cargo test && cargo clippy --tests && cargo fmt -- --config imports_granularity=Item
    (Additionally: just fmt, just fix -p codex-core, cargo check -p codex-core.)

Docs
No user-facing CLI changes. No README/help updates needed.

Risk/Impact
Reduces prompts on non-sandboxed platforms when DangerFullAccess is explicitly chosen; consistent with policy semantics.

@github-actions

github-actions Bot commented Aug 31, 2025 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Sing303

Sing303 commented Aug 31, 2025

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@Sing303

Sing303 commented Aug 31, 2025

Copy link
Copy Markdown
Contributor Author

recheck

@aliceTheFarmer

Copy link
Copy Markdown

same problem, not fixed yet

@angeloprado

Copy link
Copy Markdown

can someone approve this? It's making windows usage overly challenging

@Sing303

Sing303 commented Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

Hi @bolinfest @nornagon-openai @pakrym-oai — friendly ping for a review/decision on this PR.
Users are blocked and asking for this fix (refs: #2860, #2969, #2828, #2710).

Workflows are pending maintainer approval (so CI hasn’t run yet). The branch is up to date with main.

If you’re not the right reviewers, could you please tag the right owner? Thanks!

@febrianmosii

Copy link
Copy Markdown

yes please, this issue quite challenging, the rest is great..

Prefer `if` in match guard instead of matches!().
@bolinfest
bolinfest self-requested a review September 3, 2025 17:43
@bolinfest

Copy link
Copy Markdown
Collaborator

Thanks for this!

@bolinfest
bolinfest merged commit 0e827b6 into openai:main Sep 3, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 3, 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.

5 participants