Skip to navigation

Check a Codex Tool Call

View as MarkdownOpen in Claude

Checks a Codex PreToolUse hook. Extra input fields are accepted and ignored. An allowed call returns {} so Codex follows its own approval settings. A denied call returns a deny decision prefixed with NeMo Guardrails: . An error status indicates a failed hook. An allow is exactly {} and a deny has only the fields shown, because Codex treats an unknown field as a failed hook and runs the tool.

See Hooks Server Results and Errors for error codes and the Retry-After: 30 header on a full queue.

Codex uses a command hook to send its input; use curl -f and || exit 2 so an error status blocks the call. See Check Codex Tool Calls with the Hooks Server.

Request

This endpoint expects an object.
hook_event_name"PreToolUse"Required

The event must be PreToolUse. Other events return 422 with unsupported_hook_event.

tool_inputmap from strings to any or list of any or string or double or boolean or nullRequired
Tool call arguments. A value that is not a JSON object is denied.
tool_namestringRequired>=1 character

The tool name, matched exactly by the policy and per-tool rails. It must not be empty.

tool_use_idstringRequired

Response

Allow or deny decision
map from strings to any
OR
PreToolUseDenyobject

Errors

422
Unprocessable Entity Error
500
Internal Server Error
503
Service Unavailable Error