Service eligibility and regional restrictions
PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.
Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.
Key Takeaways
- 0.173.0 supports onFailure: "block" on synchronous command and mcp_tool hooks.
- The default is continue; block prevents a call when PreToolUse is marked Failed.
- permissionDecision: "deny" and exit code 2 with a reason are explicit denials; onFailure handles execution failure.
- Async commands and specified events do not support failure blocking.
What 0.173.0 adds
The 0.173.0 release notes add a limited behavior: synchronous command and MCP tool hooks can set onFailure: "block". If a PreToolUse hook does not execute successfully or produce a parseable result, Codex turns the failure into a blocked status so the pending tool call does not proceed. This covers a precheck that failed; it does not mean Codex verified the checker or that every hook denies by default.
Keep three outcomes distinct: whether a hook ran, the decision it returned, and whether execution failed. The new policy changes only the third outcome. If a checker should stop a command, confirm the running CLI version, event, and handler type are in scope. One config field does not prove an entire environment is protected.
Field spelling, placement, and default
The case-sensitive field uses camel case: onFailure. Its value is the lowercase string "block". It belongs in a hook handler config object, not a top-level option or hook output JSON. The 0.173.0 protocol defines this optional policy for command and mcp_tool handlers. Only a synchronous hook can stop a call in time, so do not use it on an async command hook.
When omitted, the protocol defaults to continue, so this policy alone does not block a call on hook failure. To block on failure, add `"onFailure": "block"` to the relevant synchronous handler config. This is handler-scoped and does not change other handlers left on continue. Check the CLI version actually launched and effective config file.
Explicit denial differs from execution failure
A hook may run successfully and intentionally deny. In the PreToolUse response, `permissionDecision` set to `"deny"` with a reason is an explicit block. A process that exits with code 2 and writes a nonempty reason to stderr is also an explicit block. These express the checker’s decision and do not depend on onFailure.
onFailure handles runs Codex classifies as Failed, such as a process that cannot start, output that cannot be parsed as expected, or an unexpected status. With onFailure: "block" on synchronous PreToolUse, that failure becomes blocked. This version treats exit code 2 without a nonempty stderr reason as Failed rather than reasoned denial; the failure policy then decides whether to block.
Supported scope and version boundary
The 0.173.0 discovery logic rejects onFailure: "block" on SessionEnd, PreModelRequest, and PostModelRequest. It also rejects asynchronous command handlers because they cannot synchronously stop a tool call. MCP tool handlers do not support SessionEnd either. This guide covers synchronous PreToolUse only; it does not claim every event or future version has the same support.
The general OpenAI Hooks page covers hook concepts, but this version-specific policy should be checked against the 0.173.0 release notes and tagged protocol, discovery, and PreToolUse implementation. Recheck the matching tag when upgrading. If config loading reports unsupported scope, correct it rather than bypassing validation by changing capitalization.
Check safely in an isolated directory
First confirm the CLI reports 0.173.0 and inspect the effective config for event, handler type, async status, and onFailure value. For runtime observation, use a disposable test directory with a harmless local command and test hook with no network or side effects. Do not connect a real MCP service, call an API, use authorization credentials, or modify files, accounts, or cloud resources.
A test only demonstrates behavior for that version, config, and input. It does not prove the checker is complete, that no other call path exists, or that production calls will all be intercepted. Independently review production config and workflow and keep normal human approval and least-privilege boundaries. Do not present onFailure: "block" as a universal security boundary.
Sources
Frequently Asked Questions
Is onFailure the same as permissionDecision?
No. onFailure is handler config for execution failure; permissionDecision is a decision in PreToolUse output.
Does an unset onFailure block a call?
No. The default is continue; blocking on failure requires an explicit setting on a supported synchronous handler.
Does exit code 2 always mean denial?
No. In this version, it is explicit when stderr includes a nonempty reason; otherwise it is Failed and onFailure applies.
Can it be used on async commands or every event?
No. The discovery code rejects asynchronous command handlers and specified unsupported events.
How can I verify safely?
Use a disposable directory and harmless local test without network, real tools, APIs, or authorization credentials.