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

# nemoguardrails.library.topic_safety.actions

## Module Contents

### Functions

| Name                                                                                                | Description |
| --------------------------------------------------------------------------------------------------- | ----------- |
| [`topic_safety_check_input`](#nemoguardrails-library-topic_safety-actions-topic_safety_check_input) | -           |

### Data

[`TOPIC_SAFETY_MAX_TOKENS`](#nemoguardrails-library-topic_safety-actions-TOPIC_SAFETY_MAX_TOKENS)

[`TOPIC_SAFETY_OUTPUT_RESTRICTION`](#nemoguardrails-library-topic_safety-actions-TOPIC_SAFETY_OUTPUT_RESTRICTION)

[`TOPIC_SAFETY_TEMPERATURE`](#nemoguardrails-library-topic_safety-actions-TOPIC_SAFETY_TEMPERATURE)

[`log`](#nemoguardrails-library-topic_safety-actions-log)

### API

```python
nemoguardrails.library.topic_safety.actions.topic_safety_check_input(
    llms: typing.Dict[str, nemoguardrails.types.LLMModel],
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    model_name: typing.Optional[str] = None,
    context: typing.Optional[dict] = None,
    events: typing.Optional[typing.List[dict]] = None,
    model_caches: typing.Optional[typing.Dict[str, nemoguardrails.llm.cache.CacheInterface]] = None,
    kwargs = {}
) -> dict
```

async

```python
nemoguardrails.library.topic_safety.actions.TOPIC_SAFETY_MAX_TOKENS = 10
```

```python
nemoguardrails.library.topic_safety.actions.TOPIC_SAFETY_OUTPUT_RESTRICTION = 'If any of the above conditions are violated, please respond with "off-topic". O...
```

```python
nemoguardrails.library.topic_safety.actions.TOPIC_SAFETY_TEMPERATURE = 0.01
```

```python
nemoguardrails.library.topic_safety.actions.log = logging.getLogger(__name__)
```