> 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.jailbreak_detection.model_based.checks

## Module Contents

### Functions

| Name                                                                                                                  | Description                                                                            |
| --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [`_ensure_model_downloaded`](#nemoguardrails-library-jailbreak_detection-model_based-checks-_ensure_model_downloaded) | -                                                                                      |
| [`check_jailbreak`](#nemoguardrails-library-jailbreak_detection-model_based-checks-check_jailbreak)                   | Use embedding-based jailbreak detection model to check for the presence of a jailbreak |
| [`initialize_model`](#nemoguardrails-library-jailbreak_detection-model_based-checks-initialize_model)                 | Initialize the global classifier model according to the configuration provided.        |

### Data

[`MODEL_FILENAME`](#nemoguardrails-library-jailbreak_detection-model_based-checks-MODEL_FILENAME)

[`MODEL_REPO_ID`](#nemoguardrails-library-jailbreak_detection-model_based-checks-MODEL_REPO_ID)

[`logger`](#nemoguardrails-library-jailbreak_detection-model_based-checks-logger)

### API

```python
nemoguardrails.library.jailbreak_detection.model_based.checks._ensure_model_downloaded(
    classifier_path: str
) -> pathlib.Path
```

```python
nemoguardrails.library.jailbreak_detection.model_based.checks.check_jailbreak(
    prompt: str,
    classifier = None
) -> dict
```

Use embedding-based jailbreak detection model to check for the presence of a jailbreak
Args:
prompt: User utterance to classify
classifier: Instantiated JailbreakClassifier object

**Raises:**

* `RuntimeError`: If no classifier is available and EMBEDDING\_CLASSIFIER\_PATH is not set

```python
nemoguardrails.library.jailbreak_detection.model_based.checks.initialize_model() -> typing.Union[None, JailbreakClassifier]
```

Initialize the global classifier model according to the configuration provided.
Args
classifier\_path: Path to the classifier model
Returns
jailbreak\_classifier: JailbreakClassifier object combining embedding model and NemoGuard JailbreakDetect RF

```python
nemoguardrails.library.jailbreak_detection.model_based.checks.MODEL_FILENAME = 'snowflake.onnx'
```

```python
nemoguardrails.library.jailbreak_detection.model_based.checks.MODEL_REPO_ID = 'nvidia/NemoGuard-JailbreakDetect'
```

```python
nemoguardrails.library.jailbreak_detection.model_based.checks.logger = logging.getLogger(__name__)
```