Files
codex/codex-rs/core
Michael Bolin 68d6db57c6 core: remove stale apply_patch SandboxPolicy TODO in seatbelt
The TODO in core/src/seatbelt.rs claimed that apply_patch still needed to
honor SandboxPolicy. That was true when the comment was added, but it is no
longer true.

Analysis:
- The TODO was introduced in commit 5a0ad5ab8f (PR #1762), when seatbelt code
  was split out of exec.rs.
- apply_patch sandboxing was later implemented in commit 355cded1ab
  (PR #1705: "fix: run apply_patch calls through the sandbox").
- Today, apply_patch calls are routed through the tool orchestrator and
  delegated to ApplyPatchRuntime, which executes via execute_env using the
  active sandbox attempt policy.
- On macOS, the sandbox transform path for that execution still builds
  seatbelt args with create_seatbelt_command_args(command, policy,
  sandbox_policy_cwd), so the same SandboxPolicy gates apply_patch writes and
  network behavior.

Because this behavior is already enforced, the TODO is stale and removing it
avoids implying missing sandbox coverage where none exists.

No functional behavior change; comment-only cleanup.
2026-02-10 10:51:33 -08:00
..
2026-01-20 14:02:07 -08:00

codex-core

This crate implements the business logic for Codex. It is designed to be used by the various Codex UIs written in Rust.

Dependencies

Note that codex-core makes some assumptions about certain helper utilities being available in the environment. Currently, this support matrix is:

macOS

Expects /usr/bin/sandbox-exec to be present.

When using the workspace-write sandbox policy, the Seatbelt profile allows writes under the configured writable roots while keeping .git (directory or pointer file), the resolved gitdir: target, and .codex read-only.

Linux

Expects the binary containing codex-core to run the equivalent of codex sandbox linux (legacy alias: codex debug landlock) when arg0 is codex-linux-sandbox. See the codex-arg0 crate for details.

All Platforms

Expects the binary containing codex-core to simulate the virtual apply_patch CLI when arg1 is --codex-run-as-apply-patch. See the codex-arg0 crate for details.