Skip to content

CM-73962: Stop sending explicit allow decisions from the Codex hook - #566

Merged
Altruistus merged 1 commit into
mainfrom
CM-73962-guardrail-hook-unsupported-permission-decision-allow-codex
Oct 5, 2026
Merged

Altruistus merged 1 commit into
mainfrom
CM-73962-guardrail-hook-unsupported-permission-decision-allow-codex

Conversation

@Altruistus

@Altruistus Altruistus commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

CM-73962: with AI Guardrails installed, Codex reported PreToolUse hook returned unsupported permissionDecision:allow on every permitted MCP call.

  • Older Codex runtimes reject an explicit PreToolUse permissionDecision: "allow". The tool still runs, but each call logs a failed hook.
  • Codex.build_hook_response now returns {} (no objection) for every allow, MCP calls and prompts alike. Codex prompts already returned {}.
  • Deny responses are unchanged: permissionDecision: "deny" plus permissionDecisionReason, so violations still block and give a reason.

Tests

  • Updated the Codex unit test: allow now returns {}.
  • Added scan_command tests for permitted and blocked Codex MCP calls.
  • pytest tests/cli/commands/ai_guardrails: 356 passed.

Note

Codex's docs say permissionDecision: "ask" is still unsupported. When the policy returns ask, Codex logs the hook error and runs the tool anyway. This PR leaves ask unchanged until Codex supports it.

🤖 Generated with Claude Code

Older Codex runtimes reject PreToolUse permissionDecision "allow" as
unsupported and report a failed hook on every permitted MCP call. Return
an empty response for allow instead; deny responses are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Altruistus
Altruistus merged commit 3667eae into main Oct 5, 2026
28 checks passed
@Altruistus
Altruistus deleted the CM-73962-guardrail-hook-unsupported-permission-decision-allow-codex branch October 5, 2026 10:36
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