[codex] Fix macOS sandbox platform allowances for document rendering#22416
Draft
dibyo-openai wants to merge 2 commits into
Draft
[codex] Fix macOS sandbox platform allowances for document rendering#22416dibyo-openai wants to merge 2 commits into
dibyo-openai wants to merge 2 commits into
Conversation
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix macOS Seatbelt policy generation for document rendering tools such as LibreOffice that initialize AppKit/CoreServices even when running headless.
workspace-writehas full-disk file read access, so Codex intentionally skipsrestricted_read_only_platform_defaults.sbpl. That part is still correct for file reads, but it meant non-file macOS platform permissions were also skipped. This moves the minimal observed required platform allowances into the always-on base policy without broadening file access.After local exploration prompted by review feedback, the base-policy additions are narrowed to:
com.apple.coreservices.launchservicesdcom.apple.windowserver.active/private/tmp/OSL_PIPE_*AF_UNIX bind pattern onlyThe follow-up exploration found these initially proposed allowances were not required for the repro and are no longer added:
kern.bootargskern.iossupportversionkern.willshutdownsecurity.mac.lockdown_mode_statecom.apple.CoreServices.coreservicesdcom.apple.hiservices-xpcservicecom.apple.lsd.mapdbThe regression test verifies
workspace-writestill has full-disk read and still skips the restricted defaults, while retaining the remaining base allowances. It also checks that broader WindowServer/ViewBridge/temp-socket rules and the removed noisy allowances are not present.Risk notes
The revised set is smaller, but the remaining permissions are still sensitive. The local matrix showed
launchservicesdavoids the abort,windowserver.activeavoids a hang, and theOSL_PIPE_*bind is required for LibreOffice to produce output. It does not by itself prove these belong in always-on base policy versus a narrower document-rendering path, so keeping this as draft for sandbox review.Renderer-side alternatives tested and found insufficient:
SAL_USE_VCLPLUGIN=svp--nolockcheck --nodefault --nologo --nofirststartwizardTesting
just fmtRUSTUP_TOOLCHAIN=1.93.1 cargo test -p codex-sandboxingRUSTUP_TOOLCHAIN=1.93.1 cargo build -p codex-cli --bin codexrender_docx.pycommand succeeds under revisedcodex sandbox macos --permissions-profile :workspace/private/tmp/codex-lo-repro/revised-pr-policy-render:python-docx-minimal.pdf,page-1.pngjust fix -p codex-sandboxinggit diff --check