Skip to content

Approver: show the judge the agent's history and the AGENTS.md it was given - #243

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

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

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Pick 4 of the Codex alignment (#237 was picks 2, 5, 6 and 9). Codex shows its guardian reviewer the conversation transcript, tool outputs included and marked as untrusted evidence, and treats AGENTS.md as the person's own instructions. Until now our judge never saw a tool output or any of the model's prose. That left out context the bare calls don't carry, such as what a script printed before the call that runs it, or what the model said it was doing.

What changes

  • transcript is new in the judge's state. It holds the bot's own history, oldest first: its messages (model), the calls it made (call), and what they returned (output), with a call_id tying each call to its output.
    • The approver walks history_nodes and history_items newest first and keeps entries within Codex's synchronous bounds: 5,000 tokens per message, 1,000 per call or output, 20,000 for all messages, 10,000 for all tool entries, and 40 entries at most. transcript_cut is set when anything is left out.
    • Each entry is redacted whole before it is cut to size.
    • Reasoning isn't shown, which matches Codex. The calls being judged stay in planned_calls.
  • standing_instructions lists the AGENTS.md files that apply to the workspace, but only when every one of them reads exactly as the bot was given them in its stored instructions (policy::given_agents_files). If a file was edited, cut short, added or removed since, none of them is shown. That way an agent can't write itself permission or drop a restriction.
  • The policy text treats standing_instructions as trusted, alongside the person's words and the environment note. It treats the whole transcript, tool outputs above all, as untrusted evidence.
  • Docs: docs/APPROVALS.md gets a new section at the top of Automatic mode, and the old "what the judge is shown" note is marked as the earlier design.

The person's words stay in request and earlier_prompts, labeled with who wrote them, so the consent rules from #237 don't change.

Tests

  • Unit tests:
    • Item formats from both providers, with the judged calls skipped.
    • The transcript bounds: clipping, the tool budget, the 40-entry cap, and keeping the newest entries.
    • Redaction happening before the cut, using a secret that straddles the cut.
    • The state carrying the transcript as untrusted and AGENTS.md as standing instructions.
    • given_agents_files: an edited file, a file cut short at a paragraph, a removed file, and a file followed by a role.
  • Integration test: a call prints text aimed at the judge and edits AGENTS.md. In the next round, the judge's state shows that output tied to its call and no longer shows the AGENTS.md files.
  • cargo test --workspace passes, apart from the two sandfs FUSE tests that can't run in this container. The approvals, query-plan, CLI and daemon Python suites pass (109 tests).

There is no visible change, so there are no screenshots.

🤖 Generated with Claude Code

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
- 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
… given

Codex shows its guardian the transcript, tool outputs included and marked
untrusted, and treats AGENTS.md as the person's instructions. The judge's
state gains the bot's own messages, calls and outputs within Codex's
synchronous bounds, and the AGENTS.md files that still read as the bot
was given them.

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 28, 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-28T01:08:57.435828Z a9936a4 Manual request
🔒 Security Review ✅ Completed 2026-10-28T01:12:14.877447Z a9936a4 Manual request

Security findings

Advisory findings (2)

ℹ️ 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.

@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: 1511057bf5

ℹ️ 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 client/src/policy.rs Resolved
…AGENTS.md only as given in full

A cut could keep the tail of a secret the redactor no longer recognizes,
so each entry is redacted before it is cut to its share. AGENTS.md files
count as standing instructions only when every file that applies reads
exactly as the bot's instructions hold them, followed by the next
composed section: a file cut short at a paragraph, added, or removed
reads as changed, and then none is shown.

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

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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 60e7fb45d8

ℹ️ 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.

Comment thread client/src/approver.rs Resolved

@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: 60e7fb45d8

ℹ️ 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 client/src/approver.rs Resolved
…ole state within one judge prompt

A registered secret with a quote in it no longer matches once its call's
arguments are JSON-escaped, so they are redacted as values first, as
planned calls are. The standing instructions and the transcript are
bounded on their own, so together the state could pass the daemon's
256 KiB prompt limit and every attempt would fail: past 240 KiB the
oldest transcript entries go first, then the standing instructions.

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

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. You're on a roll.

Reviewed commit: 21beb35384

ℹ️ 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 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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 21beb35384

ℹ️ 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.

Comment thread client/src/policy.rs Resolved
Agents write memory, so an index could be made to read as the paragraphs
an agent cut from AGENTS.md, and an empty index matched any cut at a
paragraph. Only the end, the skills or profiles list, or a role with no
list after it now marks the end of the files.

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

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: f1fd18599f

ℹ️ 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
@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: f1fd18599f

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.

A shell's result encodes what the command printed, so a printed secret
with a quote or backslash read otherwise once escaped and slipped past
redaction of the text.

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

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. 🚀

Reviewed commit: a9936a4abf

ℹ️ 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: a9936a4abf

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
lydakis merged commit c1b2af3 into main Oct 28, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 28, 2026
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