Apply remote platform semantics to exec safety checks - #42113
Merged
copyberry[bot] merged 1 commit intoSep 1, 2026
Merged
Conversation
## Why Unified exec can run commands on an OS that differs from the Codex host. Using host path and shell semantics for approval checks can therefore miss dangerous Windows and PowerShell commands sent to a remote executor. ## What changed - Thread the executor platform through command parsing, executable-name normalization, and dangerous-command classification. Legacy executors fall back to the host platform, while unknown reported platforms use Windows rules conservatively. - Bound model-facing `exec_command` rejection messages and avoid echoing the rejected command into the error. - Keep deterministic process IDs reserved after release so rejected test commands cannot reuse an earlier ID. ## Testing - Add coverage that a long dangerous PowerShell command targeting a remote Windows executor is rejected with a bounded response. - Verify deterministic process IDs advance after release. GitOrigin-RevId: a26b4a63ea3d6df7140032b88b3e7aec0b85b948
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948
branch
from
September 1, 2026 18:26
f0dedc9 to
1f4c473
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948
branch
September 1, 2026 18:27
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.
Apply remote platform semantics to exec safety checks
Why
Unified exec can run commands on an OS that differs from the Codex host. Using
host path and shell semantics for approval checks can therefore miss dangerous
Windows and PowerShell commands sent to a remote executor.
What changed
normalization, and dangerous-command classification. Legacy executors fall
back to the host platform, while unknown reported platforms use Windows rules
conservatively.
exec_commandrejection messages and avoid echoing therejected command into the error.
commands cannot reuse an earlier ID.
Testing
Windows executor is rejected with a bounded response.