> This page is for version v0.24.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

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

## Module Contents

### Classes

| Name                                                                                                            | Description |
| --------------------------------------------------------------------------------------------------------------- | ----------- |
| [`GuardChatCompletionsResponse`](#nemoguardrails-library-crowdstrike_aidr-actions-GuardChatCompletionsResponse) | -           |
| [`GuardChatCompletionsResult`](#nemoguardrails-library-crowdstrike_aidr-actions-GuardChatCompletionsResult)     | -           |
| [`GuardOutput`](#nemoguardrails-library-crowdstrike_aidr-actions-GuardOutput)                                   | -           |
| [`Message`](#nemoguardrails-library-crowdstrike_aidr-actions-Message)                                           | -           |

### Functions

| Name                                                                                                          | Description                                              |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [`_crowdstrike_aidr_outcome`](#nemoguardrails-library-crowdstrike_aidr-actions-_crowdstrike_aidr_outcome)     | Convert a CrowdStrike result into a rail decision.       |
| [`crowdstrike_aidr_guard`](#nemoguardrails-library-crowdstrike_aidr-actions-crowdstrike_aidr_guard)           | Evaluate conversation content with CrowdStrike AI Guard. |
| [`get_crowdstrike_aidr_config`](#nemoguardrails-library-crowdstrike_aidr-actions-get_crowdstrike_aidr_config) | -                                                        |

### Data

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

### API

```python
class nemoguardrails.library.crowdstrike_aidr.actions.GuardChatCompletionsResponse()
```

**Bases:** `BaseModel`

**`result`** `GuardChatCompletionsResult`

---

```python
class nemoguardrails.library.crowdstrike_aidr.actions.GuardChatCompletionsResult()
```

**Bases:** `BaseModel`

**`blocked`** `Optional[bool] = None`

Whether or not the prompt triggered a block detection.

---

**`bot_message`** `Optional[str] = None`

---

**`guard_output`** `Optional[GuardOutput] = None`

Updated structured prompt, if applicable.

---

**`transformed`** `Optional[bool] = None`

Whether or not the original input was transformed.

---

**`user_message`** `Optional[str] = None`

---

```python
class nemoguardrails.library.crowdstrike_aidr.actions.GuardOutput
```

**Bases:** `typing.TypedDict`

**`messages`** `list[Message]`

---

```python
class nemoguardrails.library.crowdstrike_aidr.actions.Message()
```

**Bases:** `BaseModel`

**`content`** `str`

---

**`role`** `str`

---

```python
nemoguardrails.library.crowdstrike_aidr.actions._crowdstrike_aidr_outcome(
    result: nemoguardrails.library.crowdstrike_aidr.actions.GuardChatCompletionsResult,
    mode: typing_extensions.Literal['input', 'output']
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

Convert a CrowdStrike result into a rail decision.

Blocking takes precedence over transformation. A transformed input rewrites
the user message, while a transformed output rewrites the bot message.

```python
nemoguardrails.library.crowdstrike_aidr.actions.crowdstrike_aidr_guard(
    mode: typing_extensions.Literal['input', 'output'],
    config: nemoguardrails.rails.llm.config.RailsConfig,
    context: collections.abc.Mapping[str, typing.Any] = {},
    user_message: typing.Optional[str] = None,
    bot_message: typing.Optional[str] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Evaluate conversation content with CrowdStrike AI Guard.

The action evaluates the user message for input rails and includes the bot
message for output rails. A successful provider response can allow, block,
or transform the active message.

Expected provider failures fail open: unsuccessful HTTP status responses,
transport failures, malformed JSON, and response-schema validation errors
are logged and return an allow outcome containing the original messages.
Unexpected programming errors are not swallowed.

**Parameters:**

**`mode`** `Literal['input', 'output']`

Whether the action is evaluating an input or output rail.

---

**`config`** `RailsConfig`

Active rails configuration.

---

**`context`** `Mapping[str, Any]` — default: \{}

Conversation context used when explicit messages are omitted.

---

**`user_message`** `Optional[str]` — default: None

Optional user message override.

---

**`bot_message`** `Optional[str]` — default: None

Optional bot message override.

---

**`http_client`** `Optional[HTTPClient]` — default: None

Optional caller-owned HTTP client. The action does not
close an injected client.

---

**Returns:** `RailOutcome`

The provider-derived rail outcome, or an allow outcome for an expected

**Raises:**

* `ValueError`: If the API token or required conversation content is
  missing.

```python
nemoguardrails.library.crowdstrike_aidr.actions.get_crowdstrike_aidr_config(
    config: nemoguardrails.rails.llm.config.RailsConfig
) -> nemoguardrails.rails.llm.config.CrowdStrikeAIDRRailConfig
```

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