Repository navigation
ci(review): add Codex as a third automated PR reviewer (ADR-0030) - #151
Conversation
Records the decision to add OpenAI Codex as a third automated PR reviewer through openai/codex-action (pinned SHA, read-only sandbox, no credentials held by the model, one comment posted by the workflow), rather than through the Codex cloud App. Mirrors ADR-0025; ADR-0008 is unchanged (advisory reviews, never a merge gate). Status: Proposed; the workflow lands in the implementing PR. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
Implements ADR-0030: openai/codex-action pinned to the v1.12 commit, same trigger paths and author gate as opencode plus /codex on demand. The workflow pre-fetches the PR metadata, previous comments and a bounded diff into the prompt; Codex runs with safety-strategy read-only (no writes, no network, no token) and the posting step publishes its final message as one PR comment with the job token. Model and codex-version are dated pins in the workflow. Names codex as the third reviewer in CLAUDE.md, AGENTS.md, REVIEW-FORMAT.md and the PR template, and updates ADR-0030 so its implementation lands in the same PR, as ADR-0025 did. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
To use Codex here, create an environment for this repo. |
…rally Copilot code review ran on #151 seconds after it opened, so it is requested through the maintainer's account (by hand or via the account-level automatic setting), not through a ruleset; the Context section no longer claims it is manual-only. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
I have everything I need. I verified the pinned PR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🔴 Blocked Executive summaryThe PR adds OpenAI Codex as a third automated reviewer via Previous issuesNo prior reviewer or human findings exist to classify. New findings🔴 Blocking (resolve before merge).github/workflows/codex.yml:168 / docs/adr/0030-codex-third-automated-reviewer.md:74-83 — false security claim:
Verification notes / limitations: I could not run the workflow (secret |
There was a problem hiding this comment.
🟡 Changes recommended
The new Codex workflow’s token permissions are insufficient to post PR comments as implemented, so the workflow will fail until corrected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds OpenAI Codex as a third automated PR reviewer using a pinned openai/codex-action workflow, and documents the governance/security rationale in a new ADR while updating reviewer references across the repo’s contribution and review-contract docs.
Changes:
- Add a new
codexGitHub Actions workflow that gathers PR context, runs Codex in a read-only sandbox, and posts a single PR comment. - Introduce ADR-0030 documenting the decision, threat-model considerations, and alternatives.
- Update reviewer lists in
CLAUDE.md,AGENTS.md,.github/REVIEW-FORMAT.md, and the PR template to include Codex.
File summaries
| File | Description |
|---|---|
docs/adr/0030-codex-third-automated-reviewer.md |
New ADR documenting the Codex reviewer decision and operational/security posture. |
CLAUDE.md |
Adds codex to the automated-reviewer trigger notes. |
AGENTS.md |
Adds codex to the automated-reviewer trigger notes. |
.github/workflows/codex.yml |
New workflow implementing Codex-based PR review and comment posting. |
.github/REVIEW-FORMAT.md |
Updates the report contract header language to include Codex. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates the template’s automated-reviewer note to include Codex. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Addresses the first review round on #151: - CodeQL (checkout of untrusted code in a privileged context, TOCTOU): the workflow is now two jobs. review holds contents:read and pull-requests:read and is the only job that checks out PR code; post holds pull-requests:write and only downloads the assembled comment as an artifact and publishes it. Before checkout, review re-reads the PR from the API, re-checks the author association and refuses heads that live in a fork; vetting and checkout use the same snapshot. - opencode (blocking): the action documents safety-strategy read-only as keeping sudo, which would let the model read the API key out of the proxy memory and print it into the posted review. Switched to drop-sudo (the action default) plus the :read-only permission profile, and rewrote the ADR posture to state the residual channel honestly. - ADR-0030 also records that the Codex cloud App is installed on the account without an environment for this repo, that /codex was chosen to avoid colliding with the App's @codex mention, and links PR #151. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🔴 Blocked Executive summaryThe PR adds a SHA-pinned Codex reviewer with a meaningful privilege split, immutable head-SHA checkout, fork rejection, and the corrected Previous issues
Anchor: threat model §3.2.6 explicitly includes abuse of repository CI through workflow files; ADR-0030’s credential and execution-posture decision does not protect a secret already exposed to a PR-modified workflow. |
Codex's round-2 finding on #151: on pull_request the workflow definition comes from the PR branch with repository secrets available, so a compromised collaborator account could rewrite codex.yml to exfiltrate OPENAI_API_KEY. The ADR now states this as an accepted residual: it is the same exposure the two existing reviewer secrets carry, bounded by a single maintainer (ADR-0008) and a project-scoped, budgeted key. Moving all three reviewers to pull_request_target or to an approval-gated environment is a cross-reviewer decision for its own ADR, not a change to smuggle into this one. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Round-1 changes, all in f327ea5:
|
PR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
New findingsNone reach the ≥80 confidence bar. Structural hygiene checks out: full commit-SHA pins for the action and Verification notes / limitations
|
…d SHA Claude's round-2 inline findings on #151: - The three comment inputs (PR comments, reviews, inline review comments) were appended to the prompt unbounded while the diff was capped; on a public repository anyone can extend that history. A shared bound_file helper now caps all four inputs with an explicit truncation notice. - head_sha was produced by a jq call inside an echo argument, so a jq failure could not trip set -e and an empty ref would have made actions/checkout fall back to main. It is now an assignment, validated as 40 hex digits, failing closed otherwise. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
On the Codex round-2 finding (workflow definition taken from the PR branch on The exposure is real, and it is not specific to this PR:
ADR-0030 now records this as an accepted residual (Negative consequences, commit 2db9452) rather than pretending the execution posture covers it. Switching to |
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🔴 Blocked Executive summaryThe new reviewer is SHA-pinned, least-privileged by job, gates PR authors and comment triggers, validates the immutable head SHA, and now bounds every prompt input. However, the Previous issues
No new findings reach the reporting threshold. The remaining open issue must be resolved before merge: run the secret-consuming definition from the protected base branch (for example, Anchor: threat model §3.2.6 and §5.5.2.b; CI review criteria in |
|
I've completed a thorough review. Here is my report. PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
New findingsNone reach the ≥80 confidence bar. I re-verified the areas prior reviewers flagged plus the assembly hand-off: the five-backtick Verification notes / limitations
|
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟡 Minor changes Executive summaryThe workflow is SHA-pinned, separates read-only review from comment posting, bounds prompt inputs, and correctly vets the immutable same-repository PR head. Most earlier security findings are resolved. However, two untrusted review-input streams are still inserted into the model prompt outside the workflow’s intended data fence. Previous issues
🟡 Important (should be resolved).github/workflows/codex.yml:181-185 — untrusted prompt inputs escape the intended data boundary (confidence: 85)
|
…fix repo-map rows Claude's round-3 inline findings on #151: - reviews.md and review-comments.md were spliced into the prompt outside a fence while comments.txt and the diff were fenced; all four sections are fenced now, and the instructions state that everything after the '## Pull request' heading is untrusted data. - The OPENAI_API_KEY check ran before the head vetting, so a collaborator's fork PR (which gets no secrets) failed with a misleading configuration error; the check now runs after the vet. - The repo-map row for REVIEW-FORMAT.md in CLAUDE.md and the key-files row in AGENTS.md still said 'both automated reviewers'; ADR-0030's list of places to update names those rows too. The upload-artifact v7 / download-artifact v8 pairing flagged in the same round is left as is: both live runs on this branch fetched the artifact with it, and upload-artifact has no v8. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟡 Minor changes Executive summaryThe workflow is SHA-pinned, privilege-split, fail-closed before checkout, and now bounds and fences all prompt inputs. The prior documentation and ordering issues are resolved. Two residual risks remain documented or only partially mitigated. Previous issues
New findingsNone. The remaining partly resolved prompt-boundary issue should use a per-run, unguessable delimiter (and retain the explicit instruction that all delimited content is data). A public commenter can otherwise include a matching five-backtick line and place text outside the intended data region. Anchor: CLAUDE.md CI/workflow review requirement; threat model §3.2.6 identifies abuse of repository CI through workflow files. |
Claude's remaining round-5 finding on #151: gh pr diff by PR number describes whatever the head is at gather time, which can differ from the vetted checkout if a push lands in between. The diff now comes from the compare API for the base and head SHAs read from the same pr.json snapshot as the checkout, so metadata, checkout and diff can no longer disagree. Exercised against PR #151 itself: same six files as gh pr diff. ADR-0030 states the extended same-snapshot guarantee. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🔴 Blocked Executive summaryThe workflow is SHA-pinned, privilege-split, bounded, and no longer exposes an Previous issues
New findings🔴 Blocking (resolve before merge)docs/adr/0030-codex-third-automated-reviewer.md:126-131 — incorrect RFC classification for a material trust-base expansion (confidence: 90)
Verification limitation: Network access is unavailable, so the pinned action’s upstream implementation and input semantics could not be independently verified. |
PR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
New findingsNone reach the ≥80 confidence bar. On the one residual (#15): it is real but not blocking for this PR. It requires push access (a same-repo branch), which the single-maintainer repository bounds to threat-model §3.2.6 — where the attacker already holds the secrets — and §7, which states explicitly that for the single-maintainer window "the bound is not zero". Both existing reviewers carry the identical property ( I re-verified the areas prior rounds flagged plus the hand-off path at head 💡 Suggestions (nice to have)
Verification notes / limitations
|
|
On the Codex round-7 finding (ADR-0030 should have gone through the RFC lane): This is the question ADR-0025 already litigated and settled for this class of change — see its Alternative 1, "Require an RFC per CLAUDE.md governance": a second external inference provider plus a second third-party reviewer action was judged an incremental expansion of an established posture (PR diffs of a public repository already go to an external inference API; the reviewer is a CI lint pass that touches no cryptographic, protocol or dependency surface of the server), and ADR-0025 is Accepted. ADR-0030 cites that precedent explicitly and applies it to a third instance rather than re-deciding it; the new action's supply-chain exposure is not waved away — it is listed under Negative consequences with its mitigations (full-SHA pin, Dependabot-driven reviewed bumps, minimal permissions, Whether this class of change should move to the RFC lane in future is a legitimate governance question, but it is a change to the threshold CLAUDE.md sets and to the precedent ADR-0025 records — i.e. the maintainer's call, not something this PR should decide implicitly. Flagged to the maintainer; not applied here. |
… Codex Claude's findings on the 6f3f9a8 rerun (#151): - A collaborator's fork PR passed the job-level author gate and then failed red at the runtime fork refusal. The job if now also requires the head to live in this repository, so such a PR is skipped cleanly; the runtime refusal stays as belt and braces. ADR-0030 says so. - The PR description never reached the prompt: gh pr view --comments prints only the comments outside a TTY, and the metadata block had no .body. The description sets the review language (REVIEW-FORMAT) and carries the justification of new dependencies (commitment 4); it is now included, bounded at 20 000 bytes and fenced like every other PR-supplied input. - The upload-artifact v7 / download-artifact v8 pairing was flagged a third time; the download step now carries a comment explaining why the pairing is correct (same Artifacts API since v4; no v8 upload line), proven by the post job on every run of this workflow. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟢 Approved Executive summaryThis adds a SHA-pinned Codex review workflow with narrowly scoped, split job permissions; vetted immutable same-repository head checkout; bounded prompt inputs; and no Previous issues
New findingsNone reach the reporting threshold. Decision: 🟢 Approved |
|
I have everything I need. I read the report contract, classified every prior issue against the current head ( PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
New findingsNone reach the ≥80 confidence bar. On the two open items:
I re-verified the areas prior rounds flagged plus the hand-off at head 💡 Suggestions (nice to have)
Verification notes / limitations
|
Code reviewPR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🟡 Minor changes Executive summaryThe PR lands a well-constructed third reviewer: Previous issues
New findings🟡 Important (should be resolved)
Verification notes / Limitations: Commit signatures cannot be verified on the runner (no |
…0 lists two more residuals Claude's round-7 findings on #151: - The .github/workflows repo-map row in CLAUDE.md still said 'the Claude reviewers' (inaccurate since opencode, and now Codex, joined). - ADR-0030 Negative consequences now record that codex-version is a by-number pin Dependabot does not track (no automated discovery for a vulnerable CLI release; mitigated by the dated-comment discipline and the drop-sudo / read-only profile), and that a same-repo PR can rewrite the governing files the model reads from the checkout (CLAUDE.md, AGENTS.md, REVIEW-FORMAT.md) — intended for a PR reviewer, same exposure and same upgrade path as the workflow itself. Claude-Session: https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN Signed-off-by: Gonzalo Fleming <[email protected]>
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟢 Approved Executive summaryThe PR adds a SHA-pinned Codex reviewer with restricted, split job permissions; immutable same-repository head validation; bounded and fenced prompt inputs; and no Previous issues
New findingsNone reach the reporting threshold. The workflow satisfies the CI review criteria in Decision: 🟢 Approved |
|
All four pinned SHAs resolve (HTTP 200), and the pinned PR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
New findingsNone reach the ≥80 confidence bar. On the two open items:
I independently re-verified the four pinned 💡 Suggestions (nice to have)
Verification notes / limitations
|
|
Reviewer: Codex (openai/codex-action, model gpt-5.6-terra) PR Review: ci(review): add Codex as a third automated PR reviewer (ADR-0030) (#151)Decision: 🟢 Approved Executive summaryThis adds a SHA-pinned Codex reviewer with least-privilege job separation, immutable same-repository head validation, bounded prompt inputs, and no Previous issues
New findingsNone reach the reporting threshold. The workflow satisfies the CI criteria in Decision: 🟢 Approved |
|
I've completed the iteration check and independently verified the workflow's central security claims against the pinned PR Review: ci(review): add Codex as a third automated PR reviewer (#151)Decision: 🟢 Approved Executive summaryThe PR adds Previous issues
(Plus one 💡 already flagged by prior reviewers: the metadata New findingsNone reach the ≥80 confidence bar. I independently re-verified the load-bearing claims:
The ADR is sound against the five MANIFIESTO commitments — it touches no cryptographic, protocol, or Cargo-dependency surface of the server, and the "both → three" documentation sweep is complete ( Verification notes / limitations
|
The three ADRs merged with Status: Proposed, as the repository does (CLAUDE.md: the Phase-1 ADRs were flipped in the #86 sweep once their implementing changes merged). Their implementing changes are on main: ADR-0030's codex workflow landed in #151 and reviews every human PR, ADR-0031's required-checks rule is live and #155 merged under it, and ADR-0032's opencode workflow landed in #157 and reviewed that PR ten times. Status and Date are the only lines touched. Supersedes #156, which carried the first two flips and fell behind main. Claude-Session: https://claude.ai/code/session_018UmL9wcgKBGFjdjGSSLafa Signed-off-by: Gonzalo Fleming <[email protected]>
Summary
Adds OpenAI Codex as a third automated PR reviewer through
openai/codex-action, and records the decision in ADR-0030. Mirrors the shape of the two existing reviewers (sameOWNER/MEMBER/COLLABORATORgate, same.github/REVIEW-FORMAT.mdcontract, pinned commit SHAs) onpull_requestonly — opencode's on-demand comment trigger is deliberately not mirrored, see below — with one deliberate tightening: the model runs with no GitHub token, no sudo, no writes and no network for its commands, and the workflow — split into a read-onlyreviewjob and a write-onlypostjob — gathers the inputs and posts the single review comment.Motivation
ADR-0025's argument for a second reviewer (different model families catch different classes of issues) applies unchanged to a third. Codex applies
AGENTS.mdreview guidance natively, and this repository already maintains that file. The ADR explains why the Actions integration was chosen over the Codex cloud App (configuration outside the repo, tied to a personal ChatGPT account; its own P0/P1 report format; push permission for itscodex fixmention command), and why no RFC is required (same reasoning as ADR-0025).Closes: n/a — the reviewer landscape audit that motivated this had no tracking issue.
Type of change
Checklist
Developer Certificate of Origin
(
git commit -s).cargo fmt --allandcargo clippy --workspace --all-targets -- -D warningslocally. (No Rust touched; N/A.)actionlintwith shellcheck.)docs/, orREADME.md) where appropriate. (ADR-0030;codexnamed as the third reviewer inCLAUDE.md,AGENTS.md,.github/REVIEW-FORMAT.mdand the PR template.)CHANGELOG.mdentry under## [Unreleased]if this change is user-visible. (N/A — internal CI, as for ADR-0025 / ci: add opencode reviewer with DeepSeek V4 Pro #66.)cargo deny check. (New third-party actions, justified in ADR-0030; not Cargo dependencies.)Security considerations
openai/codex-action@86365089…(v1.12),actions/checkout@3d3c42e5…(v7.0.1),actions/upload-artifact@043fb46d…(v7.0.1, already in use) andactions/download-artifact@3e5f45b2…(v8.0.1), full commit SHAs. The Codex CLI the action installs is pinned too (codex-version: 0.153.4, dated comment) — Dependabot does not track that input.reviewholdscontents: read+pull-requests: readand is the only job that checks out PR code;postholdspull-requests: writeand never touches a checkout — it downloads the assembled comment as a 1-day artifact and posts it. Nocontents: write, noissues: write, noid-token: write(API-key auth, not OIDC). The issue-comments endpoint is listed under the Pull requests: write permission in GitHub's permissions reference, sogh pr commentneeds nothing more.reviewjob then re-reads the PR from the API, re-checks the author's association and refuses a fork head as belt and braces — even a collaborator's, whose PR would receive no secret anyway. Vetting, checkout and the diff (fetched by base and head SHA through the compare API, not by PR number) all use the same API snapshot, so the SHA cannot move between them.pull_requestonly, no comment trigger: a/codexon-demand twin of opencode's/ocwas implemented first and removed after CodeQL flagged theissue_comment-driven checkout of a PR head in a secret-holding job (untrusted checkout in a privileged context + TOCTOU); no runtime vetting clears those static findings, and the path only bought a re-run without a push, whichgh run rerunprovides. ADR-0030 records this as Alternative 5. The author gate isOWNER/MEMBER/COLLABORATOR; the action's own write-access check is a second gate (allow-bots: false).persist-credentials: false;GH_TOKENis a step-level env on the gather step only;safety-strategy: drop-sudo(the action's default) removes sudo, supplementary groups and capabilities before Codex starts;permission-profile: ":read-only"denies writes and network to the commands it runs; the API key is served by the action's local proxy process. Prompt injection through PR content cannot become a push, a comment or a network exfiltration. The residual channel is the review text itself, which is posted verbatim: ADR-0030 states it plainly, notes that the action documentsread-only/unsafeas the strategies that keep sudo (neither is used), and namesunprivileged-user(a separate UID) as the upgrade path.${{ }}into a shell — they are fetched withghinto files and assembled withjq/printfinside five-backtick fences.PR_NUMBERis a number from the event payload; the checkoutrefis the head SHA from the vetted API snapshot.timeout-minutes: 30bounds a runaway review's cost.OPENAI_API_KEYas a repository secret, project-scoped with a hard monthly budget (ADR-0030). It is not configured yet — the first step fails with an explicit::error::until it is (see the first run on this PR). Adding it is the one manual step.Notes for reviewers
gpt-5.6-terra, OpenAI's documented everyday starting point as of 2026-09-08) and the:read-onlypermission profile are untested against an API key in this repo: if the org lacks access to that identifier the run fails at the Codex step and the one-line pin is the fix.github-actions[bot]with a fixed<!-- codex-review -->marker and a**Reviewer:** Codexheader line, so the other reviewers' iteration check can classify it.CLAUDE.md/AGENTS.mdbut notREVIEW-FORMAT.md) and deliberately left out of scope.Proposed; the Status flip toAcceptedfollows the merge in its own commit, per the governance practice used since ADR-0025.Automated reviews
PRs authored by
dependabot[bot](and other bots) do not trigger opencode, Claude Code Review or codex.They are covered by CI (
fmt/clippy/test/deny/audit) and manual review when needed.https://claude.ai/code/session_01MvCRfjZn6hMY3bdC8ZgZWN