Skip to content

[codex] support reviewer overrides in execpolicy rules - #31061

Draft
ssetty-oai wants to merge 1 commit into
mainfrom
codex/execpolicy-rule-reviewer
Draft

ssetty-oai wants to merge 1 commit into
mainfrom
codex/execpolicy-rule-reviewer

Conversation

@ssetty-oai

@ssetty-oai ssetty-oai commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add reviewer = "user" | "auto_review" to prompt prefix_rules and requirements TOML
  • route shell, unified exec, zsh/execve, retries, and delegated approvals through the selected reviewer while preserving inherited behavior
  • keep managed reviewer constraints authoritative and surface human/automatic policy routing in approval reasons

Why

Prompt rules could require approval but could not choose human review when a thread defaulted to Auto-review.

Semantics

  • valid only with decision = "prompt"
  • forbidden > user > auto_review > inherited reviewer
  • omitted reviewer inherits turn-level approvals_reviewer
  • reviewer = "user" overrides strict Auto-review for that request
  • disallowed managed reviewer overrides fall back to configured reviewer and use neutral reason text

Tests

  • cargo test -p codex-execpolicy
  • cargo test -p codex-config requirements_exec_policy --lib
  • cargo test -p codex-core exec_approval_requirement_carries_ --lib
  • cargo test -p codex-core handle_exec_approval_routes_ --lib
  • cargo test -p codex-core exec_policy_reviewer_override_respects_managed_reviewer_requirements --lib
  • cargo test -p codex-protocol
  • cargo clippy --fix --tests --allow-dirty -p codex-execpolicy -p codex-config -p codex-core -p codex-protocol -p codex-mcp-server
  • cargo clippy --tests -p codex-core -p codex-execpolicy

Note: cargo test -p codex-core --lib was attempted but the test process aborted in unrelated agent::control::tests::resume_agent_releases_slot_after_resume_failure with a stack overflow.

romek-codes added a commit to romek-codes/nexusystem that referenced this pull request Nov 12, 2026
…o-review

- Patch codex 0.165.0 with a local port of openai/codex#31061 so
  prefix_rule(..., reviewer = "user") bypasses auto-review
- Patch: MCP tools with approval_mode = "prompt" also go to the user
- guard.rules: git push, gh pr create/merge/ready, gh release now
  prompt the user instead of being forbidden
- guard.nix: only block `git <opts> push` for Codex (prefix rules miss it)
- Atlassian MCP: prompt by default, known read tools auto (write tool
  names drift between endpoints)
- Deploy .rules as real files: Codex skips symlinked rule files, so the
  previous rules were never loaded
- Point codex-acp at the patched codex
romek-codes added a commit to romek-codes/nexusystem that referenced this pull request Nov 12, 2026
…o-review

- Patch codex 0.165.0 with a local port of openai/codex#31061 so
  prefix_rule(..., reviewer = "user") bypasses auto-review
- Patch: MCP tools with approval_mode = "prompt" also go to the user
- guard.rules: git push, gh pr create/merge/ready, gh release now
  prompt the user instead of being forbidden
- guard.nix: only block `git <opts> push` for Codex (prefix rules miss it)
- Atlassian MCP: prompt by default, known read tools auto (write tool
  names drift between endpoints)
- Deploy .rules as real files: Codex skips symlinked rule files, so the
  previous rules were never loaded
- Point codex-acp at the patched codex

This branch has not been deployed

No deployments
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