---
title: Hf Classifier (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-01-09'
featured: false
origin: official
language: en
description: >-
  flow hf classifier check input $classifier $allowed = await
  HfClassifierCheckInputAction(classifier=$classifier) if not $allowed if
  $system.config.ena
---

```coffee
flow hf classifier check input $classifier
  $allowed = await HfClassifierCheckInputAction(classifier=$classifier)

  if not $allowed
    if $system.config.enable_rails_exceptions
      send InputRailException(message="Input blocked by 'hf classifier check input' (classifier='{$classifier}').")
    else
      bot refuse to respond
    abort

flow hf classifier check output $classifier
  $allowed = await HfClassifierCheckOutputAction(classifier=$classifier)

  if not $allowed
    if $system.config.enable_rails_exceptions
      send OutputRailException(message="Output blocked by 'hf classifier check output' (classifier='{$classifier}').")
    else
      bot refuse to respond
    abort

flow hf classifier check retrieval $classifier
  $allowed = await HfClassifierCheckRetrievalAction(classifier=$classifier)

  if not $allowed
    $relevant_chunks = ""
```
