> 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 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.actions

## Module Contents

### Functions

| Name                                                                                                                   | Description                                                                    |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`jailbreak_detection_heuristics`](#nemoguardrails-library-jailbreak_detection-actions-jailbreak_detection_heuristics) | Checks the user's prompt to determine if it is attempt to jailbreak the model. |
| [`jailbreak_detection_model`](#nemoguardrails-library-jailbreak_detection-actions-jailbreak_detection_model)           | Uses a trained classifier to determine if a user input is a jailbreak attempt  |

### Data

[`log`](#nemoguardrails-library-jailbreak_detection-actions-log)

### API

```python
nemoguardrails.library.jailbreak_detection.actions.jailbreak_detection_heuristics(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    kwargs = {}
) -> bool
```

async

Checks the user's prompt to determine if it is attempt to jailbreak the model.

```python
nemoguardrails.library.jailbreak_detection.actions.jailbreak_detection_model(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    model_caches: typing.Optional[typing.Dict[str, nemoguardrails.llm.cache.CacheInterface]] = None
) -> bool
```

async

Uses a trained classifier to determine if a user input is a jailbreak attempt

```python
nemoguardrails.library.jailbreak_detection.actions.log = logging.getLogger(__name__)
```