> This page is for NeMo Relay, version v0.8.4.
> For other versions, use one of these documentation indexes:
> - Latest (v0.10.0) (default): https://docs.nvidia.com/nemo/relay/latest/llms.txt
> - dev: https://docs.nvidia.com/nemo/relay/dev/llms.txt
> - v0.10.0: https://docs.nvidia.com/nemo/relay/v0.10.0/llms.txt
> - v0.9.4: https://docs.nvidia.com/nemo/relay/v0.9.4/llms.txt
> - v0.8.4: https://docs.nvidia.com/nemo/relay/v0.8.4/llms.txt
> - v0.7.3: https://docs.nvidia.com/nemo/relay/v0.7.3/llms.txt
> - v0.6.0: https://docs.nvidia.com/nemo/relay/v0.6.0/llms.txt
> - v0.5.0: https://docs.nvidia.com/nemo/relay/v0.5.0/llms.txt

> 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 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_mark_sanitize`

```python
def register_mark_sanitize(name: str, priority: int, guardrail: EventSanitizeGuardrail) -> None
```

Register a global mark-event sanitizer.

### `deregister_mark_sanitize`

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

Remove a global mark-event sanitizer.

### `register_scope_sanitize_start`

```python
def register_scope_sanitize_start(name: str, priority: int, guardrail: EventSanitizeGuardrail) -> None
```

Register a global sanitizer for scope-start event fields.

### `deregister_scope_sanitize_start`

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

Remove a global scope-start sanitizer.

### `register_scope_sanitize_end`

```python
def register_scope_sanitize_end(name: str, priority: int, guardrail: EventSanitizeGuardrail) -> None
```

Register a global sanitizer for scope-end event fields.

### `deregister_scope_sanitize_end`

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

Remove a global scope-end sanitizer.

### `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.