[codex] Support bubblewrap in secure Docker devcontainer#17547
Merged
viyatb-oai merged 3 commits intomainfrom Apr 12, 2026
Merged
[codex] Support bubblewrap in secure Docker devcontainer#17547viyatb-oai merged 3 commits intomainfrom
viyatb-oai merged 3 commits intomainfrom
Conversation
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
seccomp=unconfinedandapparmor=unconfinedin the secure profile instead of shipping a custom seccomp profileWhy
Docker's default seccomp profile blocks bubblewrap with
pivot_root: Operation not permitted, even when the container hasCAP_SYS_ADMIN. Docker's default AppArmor profile also blocks bubblewrap withFailed to make / slave: Permission denied.A custom seccomp profile works, but it is hard for customers to audit and understand. Using Docker's standard
seccomp=unconfinedoption is clearer: the secure profile intentionally relaxes Docker's outer sandbox just enough for Codex to construct its own bubblewrap/seccomp sandbox inside the container. The default contributor profile does not get these expanded runtime settings.Validation
sed '/\\/\\*/,/\\*\\//d' .devcontainer/devcontainer.json | jq emptyjq empty .devcontainer/devcontainer.secure.jsongit diff --checkdocker build --platform=linux/arm64 -t codex-devcontainer-bwrap-test-arm64 ./.devcontainerdocker build --platform=linux/arm64 -f .devcontainer/Dockerfile.secure -t codex-devcontainer-secure-bwrap-test-arm64 .docker run -itsmoke tests:ubuntuandvscode/usr/bin/bwrapis setuid--ro-bind-databwrap commandsseccomp=unconfinedsetup:bwrap-basic-okbwrap-netns-okcodex-okcodex --version->codex-cli 0.120.0codex sandbox linux --full-auto -- /bin/sh -lc '...'-> exited 0 and printedcodex-inner-okNote: direct
bwrap --proc /procis still denied by this Docker runtime, and Codex's existing proc-mount preflight fallback handles that by retrying without--proc.