---
title: Guardrails AI (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: '2025-11-11'
featured: false
origin: official
language: en
description: >-
  flow guardrailsai check input $validator """Check input text using relevant
  Guardrails AI validators.""" $result = await ValidateGuardrailsAiInputActi
---

```coffee
flow guardrailsai check input $validator
  """Check input text using relevant Guardrails AI validators."""
  $result = await ValidateGuardrailsAiInputAction(validator=$validator, text=$user_message)
  if not $result["valid"]
    if $system.config.enable_rails_exceptions
      send GuardrailsAIException(message="Guardrails AI {$validator} validation failed")
    else
      bot refuse to respond
    abort


flow guardrailsai check output $validator
  """Check output text using relevant Guardrails AI validators."""
  $result = await ValidateGuardrailsAiOutputAction(validator=$validator, text=$bot_message)
  if not $result["valid"]
    if $system.config.enable_rails_exceptions
      send GuardrailsAIException(message="Guardrails AI {$validator} validation failed")
    else
      bot refuse to respond
    abort
```
