Repository navigation
Merged
Conversation
… to model-issued commands #751 widened _codex_child_env's allow-list (CODEX_API_KEY, the proxy vars, the CA bundle) so the nested codex exec summarizer could authenticate and reach the network -- but that allow-list only ever governs the env subprocess.run gives to Codex's own process. Codex's --sandbox read-only still runs whatever shell command the model issues (#724), and nothing here stopped such a command from reading those same secrets directly out of its own environment. _build_codex_cmd now passes -c shell_environment_policy.inherit=none, confirmed against codex-cli 0.153.2's own --help and the official Codex manual (fetched 2026-09-26) to be Codex's own documented mechanism for controlling what environment a command it spawns receives, independently of what its own process received. _codex_child_env's allow-list keeps reaching Codex's own process via the env= kwarg exactly as before, so auth and proxy access are unaffected. Added a red-then-green test asserting the -c override is present, plus a positive control in the same call: CODEX_API_KEY and HTTPS_PROXY still reach Codex's own process while the override that keeps them from a spawned command is also present. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…rsion-pin gap Self-review (Explore + oss:auditor) on the #798 fix found two real, non-blocking gaps in the prose, not in the mechanism: - inherit=none strips a spawned command's environment entirely -- PATH/HOME/locale included, not only secrets. That is an accepted trade-off (this summarizer never depends on a spawned command succeeding), but the docstring, the block comment, and the changelog fragment described only the security benefit and never said so. - The docstring cited codex-cli 0.153.2 as the verification target for the new -c override, while this repo's README pins 0.150.1 and an adjacent, untouched sentence in the SAME docstring already carries a 0.150.1 verification claim for a different flag. Reconciled: noted explicitly that shell_environment_policy was not re-verified against 0.150.1, reasoned (not observed) to be present there too since it is a long-standing Codex config key. Also names, rather than leaves implicit, the residual trust boundary the auditor flagged as unranked: a unit test can only assert the argv carries the override string, never that codex-cli genuinely honors it at runtime -- that is not verifiable from this codebase. No code change; pipeline/haiku.py's docstrings, the block comment above _CODEX_CHILD_ENV_ALLOW, and changelog.d/798.fixed.md only. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Closes #798.
What changed
#751/#792 widened
_codex_child_env()'s allow-list (CODEX_API_KEY, HTTPS_PROXY/HTTP_PROXY/NO_PROXY, SSL_CERT_FILE/NODE_EXTRA_CA_CERTS, matched case-insensitively) so the nestedcodex execsummarizer subprocess could authenticate and reach the network through a proxy. That allow-list only ever governed the environmentsubprocess.rungives to Codex's OWN process. #724 already established that Codex's--sandbox read-onlystill runs whatever shell command the model issues -- it denies writes and network, not command execution -- so a transcript-injected instruction could get the model to run a shell command inside that sandbox and read those same secrets directly out of THAT command's own environment. That is the gate-3 gap #798 names._build_codex_cmdnow appends-c shell_environment_policy.inherit=noneto thecodex execargv -- Codex's own documented mechanism (confirmed against the locally-installed codex-cli 0.153.2's own--helpoutput and the official Codex manual, fetched live) for controlling what environment a command IT SPAWNS receives, independently of what its own process receives._codex_child_env()is unchanged and still reaches Codex's own process via theenv=kwarg exactly as before, so #751's auth/proxy fix is not regressed.Trade-off named in the diff
inherit=nonegives a spawned command NO environment at all, not only no secrets -- noPATH/HOME/locale either. Accepted because this summarizer's job never depends on a spawned command succeeding. Also named: the verification above is pinned to codex-cli 0.153.2, not re-verified against 0.150.1 (the version this repo's README reports as observed working), thoughshell_environment_policyis a long-standing Codex config key rather than something new in 0.153.2. And: the new unit tests can only assert the literal flag is present in the argv Codex's own process receives -- none can spawn a realcodex execto confirm the CLI actually honors this flag at runtime, so that trust boundary is reasoned, not observed.Tests
Red (
python3 -m pytest tests/test_summarizer_sandbox_724.py -q --no-cov): 2 failed, 14 passed --_build_codex_cmdcarried no-coverride at all pre-fix. Green after the fix: 16 passed. Also ran the same file plustests/test_haiku.pytogether: 106 passed, 0 failed. Full suite not run locally (CI is the gate, per this repo's own CLAUDE.md).Self-review
Two spawned rounds (an Explore-type reviewer against the diff/checklist, and
oss:auditoragainst the 4-class audit brief) found three issues total, all fixed doc-only in a second commit: theinherit=noneall-or-nothing trade-off was unstated, the 0.153.2-vs-0.150.1 version claim sat unreconciled with an adjacent 0.150.1-verified claim in the same docstring, and the runtime trust-boundary (does codex-cli actually honor this flag) was implied but not stated.tree_snapshotcompare returned clean before and after both rounds.[AI-generated]