---
title: Jailbreak Detection (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-08-25'
featured: false
origin: official
language: en
description: >-
  flow jailbreak detection heuristics """ Heuristic checks to assess whether the
  user's prompt is an attempted jailbreak. """ $is_jailbreak = await Jail
---

```coffee
flow jailbreak detection heuristics
  """
  Heuristic checks to assess whether the user's prompt is an attempted jailbreak.
  """
  $is_jailbreak = await JailbreakDetectionHeuristicsAction

  if $is_jailbreak
    if $system.config.enable_rails_exceptions
      send JailbreakDetectionRailException(message="Jailbreak attempt detected. The user's prompt was identified as an attempted jailbreak. Please ensure your prompt adheres to the guidelines.")
    else
      bot refuse to respond
    abort

flow jailbreak detection model
  """
  Assess whether the user's prompt is an attempted jailbreak using embedding-based jailbreak detection models.
  """
  $is_jailbreak = await JailbreakDetectionModelAction

  if $is_jailbreak
    if $system.config.enable_rails_exceptions
      send JailbreakDetectionRailException(message="Jailbreak attempt detected. The user's prompt was identified as an attempted jailbreak. Please ensure your prompt adheres to the guidelines.")
    else
      bot refuse to respond
    abort
```
