---
title: Topic Safety (NeMo Guardrail)
type: guardrail
provider: nvidia
category: safety
source: 'https://github.com/NVIDIA-NeMo/Guardrails'
license: Apache-2.0
tags:
  - guardrail
  - nemo
  - rails
  - colang
dateAdded: '2026-04-13'
featured: false
origin: official
language: en
description: >-
  flow topic safety check input $model $response = await
  TopicSafetyCheckInputAction(model_name=$model) global $on_topic $on_topic =
  $response["on_topic
---

```coffee
flow topic safety check input $model
  $response = await TopicSafetyCheckInputAction(model_name=$model)

  global $on_topic
  $on_topic = $response["on_topic"]

  if not $on_topic
    if $system.config.enable_rails_exceptions
      send TopicSafetyCheckInputException(message="Input not allowed. The input was blocked by the 'topic safety check input $model='{$model}'' flow.")
    else
      bot refuse to respond
    abort
```
