Skip to content

fix: use --sandbox danger-full-access for Codex review mode#616

Merged
wesm merged 1 commit intomainfrom
fix/large-diffs
Apr 2, 2026
Merged

fix: use --sandbox danger-full-access for Codex review mode#616
wesm merged 1 commit intomainfrom
fix/large-diffs

Conversation

@wesm
Copy link
Copy Markdown
Collaborator

@wesm wesm commented Apr 2, 2026

Summary

  • Switch Codex review mode from --sandbox read-only to --sandbox danger-full-access to fix CI reviews failing on large diffs
  • The bwrap sandbox (used by both read-only and workspace-write modes) blocks loopback networking, causing git commands to fail with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted — this makes Codex unable to inspect diffs, so reviews report the code is inaccessible
  • workspace-write has the same bwrap loopback bug (openai/codex#15496), so danger-full-access is the only working option
  • Update review_guidelines to document the rationale so security reviewers don't flag it
  • Update scripts/changelog.sh to match

🤖 Generated with Claude Code

@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Apr 2, 2026

roborev: Combined Review (1d6acd4)

Verdict: Changes are not ready as-is due to 2 medium-severity regressions in Codex review execution.

Medium

  • internal/agent/codex.go:141, internal/agent/codex.go:183, scripts/changelog.sh:85
    The change assumes any Codex binary that exposes --sandbox also supports --sandbox none. The current detection only checks for the flag itself, and the changelog script does not validate support at all, so some CLI versions may now fail at runtime when invoked with none.
    Suggested fix: probe specifically for --sandbox none support, then fall back to the prior mode or another compatible path when unsupported.

  • internal/agent/codex.go:141, internal/agent/codex.go:210, scripts/changelog.sh:85
    Changing review-mode execution from read-only to none removes the previous protection against background review jobs mutating the user’s working checkout. That also reintroduces the risk of interfering with concurrent local git activity, including lock contention.
    Suggested fix: keep review runs effectively read-only by using an isolated temp clone/worktree or a sandbox mode that permits the required git reads without allowing filesystem writes.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

The bwrap sandbox (used by both read-only and workspace-write modes)
blocks loopback networking, which prevents git commands from working
in CI review jobs. Codex agents reviewing large diffs fail with
"bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted",
making reviews report that the diff was inaccessible.

Switch to --sandbox danger-full-access, which bypasses bwrap entirely.
roborev runs in trusted environments where the code is the operator's
own, so sandbox enforcement is unnecessary.

Also updates review_guidelines to document the rationale so security
reviewers don't flag it as a vulnerability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wesm wesm force-pushed the fix/large-diffs branch from 1d6acd4 to dc742d8 Compare April 2, 2026 00:35
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Apr 2, 2026

roborev: Combined Review (dc742d8)

Verdict: Changes introduce a high-severity regression by removing read-only guarantees from review execution, plus a medium-severity blast-radius increase in changelog generation.

High

  • internal/agent/codex.go:144
    Switching non-agentic review mode from --sandbox read-only to --sandbox danger-full-access removes the enforced guarantee that review runs cannot modify the user’s checkout. Because this path is used for automated review jobs, a prompt-following or misbehaving Codex run can now edit files, create index.lock, or otherwise leave the repo dirty during what is supposed to be a read-only review.
    Suggested fix: Preserve a non-mutating execution path for reviews, or isolate the full-access workaround to a temporary clone/worktree or only the specific environment that requires it.

Medium

  • scripts/changelog.sh:85
    The changelog helper now also runs Codex with danger-full-access, even though this flow only needs to read the prompt and write the generated output file. That unnecessarily broadens the blast radius of release tooling by allowing arbitrary edits to the current checkout as a side effect of generating notes.
    Suggested fix: Keep changelog generation read-only, or run the full-access invocation from an isolated temporary directory.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@wesm wesm changed the title fix: use --sandbox none for Codex review mode to allow git commands fix: use --sandbox danger-full-access for Codex review mode Apr 2, 2026
@wesm wesm merged commit 6f34ebc into main Apr 2, 2026
8 checks passed
@wesm wesm deleted the fix/large-diffs branch April 2, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant