Skip to content

RFC: Codex Integration #3408

Description

@thatjosh

Summary

This RFC proposes adding first-party Codex CLI governance to AGT as a new package, agent-governance-codex-cli. It's a thin host adapter over the existing Claude Code governance core. Codex's hook system (SessionStart, UserPromptSubmit, PreToolUse) mirrors Claude Code's contract, so the governance logic is reused unchanged and only host wiring is new, following the same derivation used for the OpenCode integration (#2658). I originally fork and extended it to govern my own Codex agent, so it's already implemented and verified, with policy deny/allow/audit working e2e. I'm happy to contribute it back upstream and help maintain this going forward.

Working fork: https://github.com/thatjosh/agent-governance-toolkit

Motivation

AGT ships governance integrations for Claude Code, Copilot CLI, OpenCode, and Antigravity, but not for the OpenAI Codex CLI, which is becoming more popular with GPT 5.6.

Detailed Design

Codex's hook system (SessionStart, UserPromptSubmit, PreToolUse) mirrors Claude Code's contract, so the governance logic is reused unchanged and only host wiring is new, following the same derivation used for the OpenCode integration (#2658).

Enforcement surface

Codex event AGT behavior
SessionStart inject governance context
UserPromptSubmit prompt inspection, fail-closed block
PreToolUse allow / deny / ask via policy

Decision mapping onto Codex's hook response schema:

// policy deny  ->
{ "hookSpecificOutput": { "hookEventName": "PreToolUse",
    "permissionDecision": "deny", "permissionDecisionReason": "…AGT policy…" } }
// policy review -> "permissionDecision": "ask"
// policy allow  -> no permissionDecision

Alternatives Considered

N/A

Security Implications

Trust model / cryptographic boundaries are unchanged. This package does not modify the policy engine, trust scoring, cryptographic choices, or the audit format. It reuses the existing Claude Code governance core unchanged and only translates Codex's hook payloads
to and from that core.

Migration / Backward Compatibility

No response

Scope

Single package

Target Placement

Integration (integrations/ directory)

Prior Art

#2658

Checklist

  • I have searched existing issues and RFCs for duplicates
  • I have read the ADR index (adr/index.md) for related decisions
  • I am willing to implement this RFC or help review an implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions