Skip to navigation

nemoguardrails.server.hooks.schemas

View as MarkdownOpen in Claude

Request models for the agent hooks the hooks server checks, one interface per agent path.

Module Contents

Classes

NameDescription
ClaudeCodePreToolUseRequestClaude Code’s PreToolUse hook input, requiring only the fields the server reads.
CodexPreToolUseRequestCodex’s PreToolUse hook input, requiring only the fields the server reads.
HookBodyThe field every hook body carries, read before the body is validated as its event.
HookErrorCodeThe error.code of a hooks request that ends in an error rather than an allow or a deny.
NemoRelayToolConditionalExecutionGuardrailRequestNeMo Relay tool conditional-execution guardrail callback receives: the tool name and its arguments.

API

class nemoguardrails.server.hooks.schemas.ClaudeCodePreToolUseRequest()

Bases: BaseModel

Claude Code’s PreToolUse hook input, requiring only the fields the server reads.

hook_event_name
Literal['PreToolUse']
model_config
= ConfigDict(extra='allow')
tool_name
str = Field(min_length=1)
tool_use_id
str
class nemoguardrails.server.hooks.schemas.CodexPreToolUseRequest()

Bases: BaseModel

Codex’s PreToolUse hook input, requiring only the fields the server reads.

hook_event_name
Literal['PreToolUse']
model_config
= ConfigDict(extra='allow')
tool_name
str = Field(min_length=1)
tool_use_id
str
class nemoguardrails.server.hooks.schemas.HookBody()

Bases: BaseModel

The field every hook body carries, read before the body is validated as its event.

hook_event_name
str
class nemoguardrails.server.hooks.HookErrorCode

Bases: enum.Enum

The error.code of a hooks request that ends in an error rather than an allow or a deny.

QUEUE_FULL
= 'queue_full'
RAIL_FAILED
= 'rail_failed'
UNSUPPORTED_HOOK_EVENT
= 'unsupported_hook_event'
class nemoguardrails.server.hooks.schemas.NemoRelayToolConditionalExecutionGuardrailRequest()

Bases: BaseModel

NeMo Relay tool conditional-execution guardrail callback receives: the tool name and its arguments.

hook_event_name
Literal['NemoRelayToolConditionalExecutionGuardrail']
model_config
= ConfigDict(extra='forbid')
tool_name
str = Field(min_length=1)