Skip to content

Approver: judge by Codex's guardian policy, deny at once, fail closed - #237

Merged
lydakis merged 3 commits into
mainfrom
claude/project-thread-6y8uvt
Oct 28, 2026
Merged

lydakis merged 3 commits into
mainfrom
claude/project-thread-6y8uvt

Conversation

@lydakis

@lydakis lydakis commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What

The auto approver now follows Codex's guardian reviewer (openai/codex cf2c04b, Apache-2.0). This PR covers the parts that don't depend on the task sandbox.

  • Codex's policy and verdict. The judge's instructions are Codex's written policy: evidence handling, authorization scoring, the risk taxonomy, data exfiltration, credential probing, persistent security weakening, destructive actions, and the outcome table. Our own rules are folded in:

    • Only the person's words and the environment note are trusted.
    • A go-ahead covers the question it answers and any calls refused right before it.
    • A one-time effect is used up once it's done.
    • A refused call redone another way is judged the same as the original.
    • Ordinary dev work is low risk.
    • Reaching the approval channel is critical.

    Each call gets one assessment: {"outcome":"allow"}, or risk_level / user_authorization / outcome / rationale. These replace the eleven probability questions that were built for Jev. The Decisions API gets the same policy plus one predicate per call ("is the outcome deny?").

  • Deny at once. A denial goes straight back to the model, using Codex's rejection wording: no workaround, take a materially safer route or ask. A risky call no longer waits for the person under Sonny's non-lapsing gate. Only a call too long to show the judge is still handed to a person, the same way Codex asks the user when a review's input is over budget.

  • Fail closed, labeled. A review gets up to 3 attempts within 90 s. If they all fail it's denied as "Automatic approval review failed: …", and a timeout gets its own message. Both are sent with the new answer field unreviewed: true, and the daemon doesn't count those toward the breaker. The CLI's auto gate expiry goes from 45 s to 105 s to fit the new budget.

  • Breaker: 3 in a row, or 10 among the turn's last 50 decided calls (was 20 per turn). The daemon keeps the window as bits on the bot's row. Listings carry {in_row, recent} and inspect shows {in_row, window, turn}. Once a denial falls out of the window, the count is dropped, so a bot that is never denied still writes nothing.

Not in this PR:

  • Showing the judge the full transcript (tool output marked untrusted, plus AGENTS.md).
  • Sonny's review status, a line per denial, and approve-one-retry.
  • Picks that wait for the task sandbox: judging only sandbox escapes, and a judge that can look before it decides.

No screenshots: nothing changes on screen except the wording of denials.

Tests

  • cargo test --workspace: all pass except the two sonny sandfs task tests, which need fuse3 and fail here on main too.
  • cargo clippy --workspace --all-targets: clean.
  • AGENT_TEST_RUNTIME=1 python3 -m unittest tests.test_approvals tests.test_query_plans tests.test_cli tests.test_daemon: 108 tests OK.
  • New store test: an unreviewed denial counts nothing, and old denials leave the window.

George asked to follow Codex's auto-approval patterns where ours were odd.
This takes the picks that need no sandbox:

- The judge gets Codex's written policy (evidence handling, authorization
  scoring, risk taxonomy, exfiltration, credential probing, security
  weakening, destructive actions, outcome table) with this agent's trust
  rules folded in, and answers one assessment a call: risk_level,
  user_authorization, outcome, rationale. The eleven probability
  questions built for Jev are gone; the Decisions API gets one predicate
  a call.
- A denial goes back to the model at once with Codex's wording. Only a
  call too long to show is still handed to a person.
- A review is tried up to 3 times within 90 s, then denied as a labeled
  review failure (or a timeout). The answer carries `unreviewed`, and the
  daemon counts it toward no breaker.
- The breaker is Codex's: 3 in a row, or 10 among the turn's last 50
  decided calls. The daemon keeps that window as bits on the bot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:09:58.814623Z 51f95f9 Manual request
🔒 Security Review ✅ Completed 2026-10-28T00:11:51.978421Z 51f95f9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

lydakis commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19c6aeadbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/approver.rs Resolved
Comment thread src/store/db.rs Resolved
- Schema 54 turns a stored per-turn count into that many denials as the
  window's newest calls, so a turn parked across the upgrade keeps its
  breaker count instead of starting from none.
- A denial's reason clips the judge's rationale to 4 KiB on a character
  boundary and names only known risk and authorization levels, so it
  always fits the daemon's 16 KiB reason limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 19c6aeadbd

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40a4efffbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/approver.rs Resolved

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 51f95f9ae3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 51f95f9ae3

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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.

2 participants