> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# nemo_relay.guardrails

> Global guardrail registration for tools and LLMs.

Generated from `python/nemo_relay/guardrails.py`.

Module `nemo_relay.guardrails`.

Global guardrail registration for tools and LLMs.

## Functions

### `register_tool_sanitize_request`

```python
def register_tool_sanitize_request(name: str, priority: int, guardrail: ToolSanitizeGuardrail) -> None
```

Register a guardrail that sanitizes tool inputs for emitted start events.

### `deregister_tool_sanitize_request`

```python
def deregister_tool_sanitize_request(name: str) -> bool
```

Remove a previously registered tool sanitize-request guardrail.

### `register_tool_sanitize_response`

```python
def register_tool_sanitize_response(name: str, priority: int, guardrail: ToolSanitizeGuardrail) -> None
```

Register a guardrail that sanitizes tool outputs for emitted end events.

### `deregister_tool_sanitize_response`

```python
def deregister_tool_sanitize_response(name: str) -> bool
```

Remove a previously registered tool sanitize-response guardrail.

### `register_tool_conditional_execution`

```python
def register_tool_conditional_execution(name: str, priority: int, guardrail: ToolConditionalExecutionGuardrail) -> None
```

Register a guardrail that can reject a tool call before execution.

### `deregister_tool_conditional_execution`

```python
def deregister_tool_conditional_execution(name: str) -> bool
```

Remove a previously registered tool conditional-execution guardrail.

### `register_llm_sanitize_request`

```python
def register_llm_sanitize_request(name: str, priority: int, guardrail: LlmSanitizeRequestGuardrail) -> None
```

Register a guardrail that sanitizes LLM requests for emitted start events.

### `deregister_llm_sanitize_request`

```python
def deregister_llm_sanitize_request(name: str) -> bool
```

Remove a previously registered LLM sanitize-request guardrail.

### `register_llm_sanitize_response`

```python
def register_llm_sanitize_response(name: str, priority: int, guardrail: LlmSanitizeResponseGuardrail) -> None
```

Register a guardrail that sanitizes LLM outputs for emitted end events.

### `deregister_llm_sanitize_response`

```python
def deregister_llm_sanitize_response(name: str) -> bool
```

Remove a previously registered LLM sanitize-response guardrail.

### `register_llm_conditional_execution`

```python
def register_llm_conditional_execution(name: str, priority: int, guardrail: LlmConditionalExecutionGuardrail) -> None
```

Register a guardrail that can reject an LLM call before execution.

### `deregister_llm_conditional_execution`

```python
def deregister_llm_conditional_execution(name: str) -> bool
```

Remove a previously registered LLM conditional-execution guardrail.