Skip to content

Apply remote platform semantics to exec safety checks - #42113

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948
Sep 1, 2026
Merged

Apply remote platform semantics to exec safety checks#42113
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

  • 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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948 branch from f0dedc9 to 1f4c473 Compare September 1, 2026 18:26
@copyberry
copyberry Bot merged commit 1f4c473 into main Sep 1, 2026
24 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/a26b4a63ea3d6df7140032b88b3e7aec0b85b948 branch September 1, 2026 18:27
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
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.

1 participant