diff --git a/.github/workflows/codex-pr-review.yml b/.github/workflows/codex-pr-review.yml index 68bea1d715..1e7dda7448 100644 --- a/.github/workflows/codex-pr-review.yml +++ b/.github/workflows/codex-pr-review.yml @@ -306,14 +306,11 @@ jobs: if [ "$PR_IS_FORK" = "true" ]; then # Fork code is untrusted. Read the review policy/prompt from the base # ref (git show) rather than the attacker-controlled merge checkout, - # so a malicious fork can't rewrite the reviewer's own instructions, - # and run in a network-disabled sandbox to block secret exfiltration. + # so a malicious fork can't rewrite the reviewer's own instructions. git show "origin/$PR_BASE_REF:REVIEW.md" > /tmp/codex-prompt.md git show "origin/$PR_BASE_REF:.github/codex/pr-review.prompt.md" >> /tmp/codex-prompt.md - SANDBOX_MODE=workspace-write else cat REVIEW.md .github/codex/pr-review.prompt.md > /tmp/codex-prompt.md - SANDBOX_MODE=danger-full-access fi # The context file lives in RUNNER_TEMP (outside the attacker-controlled # checkout); tell the agent its absolute path. @@ -321,11 +318,17 @@ jobs: # Write the final message outside the checkout too: a fork could commit # codex-final-message.md as a symlink and redirect this write to overwrite # e.g. a GitHub Action's index.js, which then runs with our credentials. + # + # Bypass the sandbox entirely instead of selecting a sandbox mode: Codex's + # bwrap sandbox fails to initialize its network namespace on this runner + # (`bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted`) and aborts + # before reading any file, so no review is possible with it enabled. The + # runner is already an ephemeral, externally sandboxed CI environment. codex exec \ -C "$GITHUB_WORKSPACE" \ -m gpt-5.6-sol \ -c 'model_reasoning_effort="xhigh"' \ - -s "$SANDBOX_MODE" \ + --dangerously-bypass-approvals-and-sandbox \ -o "$RUNNER_TEMP/codex-final-message.md" \ - < /tmp/codex-prompt.md