> This page is for version v0.24.1.
> 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.autoalign.actions

## Module Contents

### Functions

| Name                                                                                                               | Description                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| [`_autoalign_outcome`](#nemoguardrails-library-autoalign-actions-_autoalign_outcome)                               | -                                                                                                                  |
| [`_autoalign_post`](#nemoguardrails-library-autoalign-actions-_autoalign_post)                                     | -                                                                                                                  |
| [`_autoalign_score_outcome`](#nemoguardrails-library-autoalign-actions-_autoalign_score_outcome)                   | -                                                                                                                  |
| [`autoalign_factcheck_infer`](#nemoguardrails-library-autoalign-actions-autoalign_factcheck_infer)                 | -                                                                                                                  |
| [`autoalign_factcheck_output_api`](#nemoguardrails-library-autoalign-actions-autoalign_factcheck_output_api)       | Calls Autoalign Factchecker API and checks if the user message is factually answered by the bot message            |
| [`autoalign_groundedness_infer`](#nemoguardrails-library-autoalign-actions-autoalign_groundedness_infer)           | Checks the groundedness for the text using the given documents and provides a fact-checking score                  |
| [`autoalign_groundedness_output_api`](#nemoguardrails-library-autoalign-actions-autoalign_groundedness_output_api) | Calls AutoAlign groundedness check API and checks whether the bot message is factually grounded according to given |
| [`autoalign_infer`](#nemoguardrails-library-autoalign-actions-autoalign_infer)                                     | Checks whether the given text passes through the applied guardrails.                                               |
| [`autoalign_input_api`](#nemoguardrails-library-autoalign-actions-autoalign_input_api)                             | Calls AutoAlign API for the user message and guardrail configuration provided                                      |
| [`autoalign_output_api`](#nemoguardrails-library-autoalign-actions-autoalign_output_api)                           | Calls AutoAlign API for the bot message and guardrail configuration provided                                       |
| [`process_autoalign_output`](#nemoguardrails-library-autoalign-actions-process_autoalign_output)                   | Processes the output provided AutoAlign API                                                                        |

### Data

[`DEFAULT_CONFIG`](#nemoguardrails-library-autoalign-actions-DEFAULT_CONFIG)

[`GUARDRAIL_RESPONSE_TEXT`](#nemoguardrails-library-autoalign-actions-GUARDRAIL_RESPONSE_TEXT)

[`default_groundedness_config`](#nemoguardrails-library-autoalign-actions-default_groundedness_config)

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

### API

```python
nemoguardrails.library.autoalign.actions._autoalign_outcome(
    result: dict,
    target: nemoguardrails.actions.rail_outcome.TransformTarget
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

```python
nemoguardrails.library.autoalign.actions._autoalign_post(
    http_client: nemoguardrails.http.HTTPClient | None,
    request_url: str,
    headers: dict[str, str],
    request_body: dict[str, typing.Any]
) -> nemoguardrails.http.HTTPResponse
```

async

```python
nemoguardrails.library.autoalign.actions._autoalign_score_outcome(
    score: float,
    threshold: float
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

```python
nemoguardrails.library.autoalign.actions.autoalign_factcheck_infer(
    request_url: str,
    user_message: str,
    bot_message: str,
    guardrails_config: typing.Optional[typing.Dict[str, typing.Any]] = None,
    multi_language: bool = False,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
)
```

async

```python
nemoguardrails.library.autoalign.actions.autoalign_factcheck_output_api(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    user_message: typing.Optional[str] = None,
    bot_message: typing.Optional[str] = None,
    factcheck_threshold: float = 0.0,
    show_autoalign_message: bool = True,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Calls Autoalign Factchecker API and checks if the user message is factually answered by the bot message

Scores below `factcheck_threshold` block. Configuration, transport,
status, and response parsing failures propagate to the caller.

**Parameters:**

**`llm_task_manager`** `LLMTaskManager`

Task manager containing the AutoAlign configuration.

---

**`context`** `Optional[dict]` — default: None

Runtime context containing the user and bot messages.

---

**`factcheck_threshold`** `float` — default: 0.0

Minimum score required to allow the response.

---

**`show_autoalign_message`** `bool` — default: True

Whether to log detected violations.

---

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

Optional caller-owned HTTP client.

---

**Returns:** `RailOutcome`

An allow or block outcome containing the score and threshold.

```python
nemoguardrails.library.autoalign.actions.autoalign_groundedness_infer(
    request_url: str,
    text: str,
    documents: typing.List[str],
    guardrails_config: typing.Optional[typing.Dict[typing.Any, typing.Any]] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
)
```

async

Checks the groundedness for the text using the given documents and provides a fact-checking score

```python
nemoguardrails.library.autoalign.actions.autoalign_groundedness_output_api(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    factcheck_threshold: float = 0.0,
    show_autoalign_message: bool = True,
    bot_message: typing.Optional[str] = None,
    relevant_chunks_sep: typing.Optional[typing.List[str]] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None,
    kwargs = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Calls AutoAlign groundedness check API and checks whether the bot message is factually grounded according to given
documents

Scores below `factcheck_threshold` block. Configuration, transport,
status, and response parsing failures propagate to the caller.

**Parameters:**

**`llm_task_manager`** `LLMTaskManager`

Task manager containing the AutoAlign configuration.

---

**`context`** `Optional[dict]` — default: None

Runtime context containing the bot message and documents.

---

**`factcheck_threshold`** `float` — default: 0.0

Minimum score required to allow the response.

---

**`show_autoalign_message`** `bool` — default: True

Whether to log detected violations.

---

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

Optional caller-owned HTTP client.

---

**`**kwargs`** — default: \{}

Additional action parameters.

---

**Returns:** `RailOutcome`

An allow or block outcome containing the score and threshold.

```python
nemoguardrails.library.autoalign.actions.autoalign_infer(
    request_url: str,
    text: str,
    task_config: typing.Optional[typing.Dict[typing.Any, typing.Any]] = None,
    show_toxic_phrases: bool = False,
    multi_language: bool = False,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
)
```

async

Checks whether the given text passes through the applied guardrails.

```python
nemoguardrails.library.autoalign.actions.autoalign_input_api(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    user_message: typing.Optional[str] = None,
    show_autoalign_message: bool = True,
    show_toxic_phrases: bool = False,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None,
    kwargs = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Calls AutoAlign API for the user message and guardrail configuration provided

Guardrail matches block, PII redactions transform the user message, and
other results allow it. Configuration, transport, status, and response
parsing failures propagate to the caller.

**Parameters:**

**`llm_task_manager`** `LLMTaskManager`

Task manager containing the AutoAlign configuration.

---

**`context`** `Optional[dict]` — default: None

Runtime context containing the user message.

---

**`show_autoalign_message`** `bool` — default: True

Whether to log detected violations.

---

**`show_toxic_phrases`** `bool` — default: False

Whether violation messages include toxic phrases.

---

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

Optional caller-owned HTTP client.

---

**`**kwargs`** — default: \{}

Additional action parameters.

---

**Returns:** `RailOutcome`

An allow, block, or user-message transform outcome.

```python
nemoguardrails.library.autoalign.actions.autoalign_output_api(
    llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
    context: typing.Optional[dict] = None,
    bot_message: typing.Optional[str] = None,
    show_autoalign_message: bool = True,
    show_toxic_phrases: bool = False,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None,
    kwargs = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Calls AutoAlign API for the bot message and guardrail configuration provided

Guardrail matches block, PII redactions transform the bot message, and
other results allow it. Configuration, transport, status, and response
parsing failures propagate to the caller.

**Parameters:**

**`llm_task_manager`** `LLMTaskManager`

Task manager containing the AutoAlign configuration.

---

**`context`** `Optional[dict]` — default: None

Runtime context containing the bot message.

---

**`show_autoalign_message`** `bool` — default: True

Whether to log detected violations.

---

**`show_toxic_phrases`** `bool` — default: False

Whether violation messages include toxic phrases.

---

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

Optional caller-owned HTTP client.

---

**`**kwargs`** — default: \{}

Additional action parameters.

---

**Returns:** `RailOutcome`

An allow, block, or bot-message transform outcome.

```python
nemoguardrails.library.autoalign.actions.process_autoalign_output(
    responses: typing.List[typing.Any],
    show_toxic_phrases: bool = False
)
```

Processes the output provided AutoAlign API

```python
nemoguardrails.library.autoalign.actions.DEFAULT_CONFIG = {'pii': {'mode': 'OFF', 'mask': False, 'enabled_types': ['[BANK ACCOUNT NUMBER]'...
```

```python
nemoguardrails.library.autoalign.actions.GUARDRAIL_RESPONSE_TEXT = {'confidential_info_detection': 'Confidential Information violation', 'gender_bi...
```

```python
nemoguardrails.library.autoalign.actions.default_groundedness_config = {'groundedness_checker': {'verify_response': False}}
```

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