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

## Module Contents

### Functions

| Name                                                                                             | Description                                                    |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| [`_fiddler_outcome`](#nemoguardrails-library-fiddler-actions-_fiddler_outcome)                   | -                                                              |
| [`call_fiddler_faithfulness`](#nemoguardrails-library-fiddler-actions-call_fiddler_faithfulness) | Check the bot message with the Fiddler faithfulness guardrail. |
| [`call_fiddler_guardrail`](#nemoguardrails-library-fiddler-actions-call_fiddler_guardrail)       | Evaluate content with a Fiddler guardrail endpoint.            |
| [`call_fiddler_safety_bot`](#nemoguardrails-library-fiddler-actions-call_fiddler_safety_bot)     | Check the bot message with the Fiddler safety guardrail.       |
| [`call_fiddler_safety_user`](#nemoguardrails-library-fiddler-actions-call_fiddler_safety_user)   | Check the user message with the Fiddler safety guardrail.      |

### Data

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

### API

```python
nemoguardrails.library.fiddler.actions._fiddler_outcome(
    blocked: bool
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

```python
nemoguardrails.library.fiddler.actions.call_fiddler_faithfulness(
    config: nemoguardrails.RailsConfig,
    context: typing.Optional[dict] = None,
    bot_message: typing.Optional[str] = None,
    relevant_chunks: typing.Optional[str] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Check the bot message with the Fiddler faithfulness guardrail.

Scores at or below the configured threshold block. Missing content,
missing endpoint configuration, and handled provider failures fail open.

**Parameters:**

**`config`** `RailsConfig`

Rails configuration containing the Fiddler settings.

---

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

Runtime context containing the bot message and relevant
chunks.

---

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

Optional caller-owned HTTP client.

---

**Returns:** `RailOutcome`

An allow or block outcome.

**Raises:**

* `ValueError`: If `FIDDLER_API_KEY` is not set.

```python
nemoguardrails.library.fiddler.actions.call_fiddler_guardrail(
    endpoint: str,
    data: dict,
    guardrail_name: str,
    score_key: str,
    threshold: float,
    compare: typing.Callable[[float, float], bool],
    default_score: float,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> bool
```

async

Evaluate content with a Fiddler guardrail endpoint.

Non-success responses, HTTP client failures, and expected score-processing
failures are logged and fail open.

**Parameters:**

**`endpoint`** `str`

Fiddler guardrail endpoint.

---

**`data`** `dict`

Guardrail-specific request data.

---

**`guardrail_name`** `str`

Name used in diagnostic messages.

---

**`score_key`** `str`

Response score used for the decision.

---

**`threshold`** `float`

Configured decision threshold.

---

**`compare`** `Callable[[float, float], bool]`

Comparison used to determine whether content is blocked.

---

**`default_score`** `float`

Score used when the response omits `score_key`.

---

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

Optional caller-owned HTTP client.

---

**Returns:** `bool`

`True` when the guardrail blocks the content, otherwise `False`.

**Raises:**

* `ValueError`: If `FIDDLER_API_KEY` is not set.

```python
nemoguardrails.library.fiddler.actions.call_fiddler_safety_bot(
    config: nemoguardrails.RailsConfig,
    context: typing.Optional[dict] = None,
    bot_message: typing.Optional[str] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Check the bot message with the Fiddler safety guardrail.

Scores at or above the configured threshold block. Missing content,
missing endpoint configuration, and handled provider failures fail open.

**Parameters:**

**`config`** `RailsConfig`

Rails configuration containing the Fiddler settings.

---

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

Runtime context containing the bot message.

---

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

Optional caller-owned HTTP client.

---

**Returns:** `RailOutcome`

An allow or block outcome.

**Raises:**

* `ValueError`: If `FIDDLER_API_KEY` is not set.

```python
nemoguardrails.library.fiddler.actions.call_fiddler_safety_user(
    config: nemoguardrails.RailsConfig,
    context: typing.Optional[dict] = None,
    user_message: typing.Optional[str] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Check the user message with the Fiddler safety guardrail.

Scores at or above the configured threshold block. Missing content,
missing endpoint configuration, and handled provider failures fail open.

**Parameters:**

**`config`** `RailsConfig`

Rails configuration containing the Fiddler settings.

---

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

Runtime context containing the user message.

---

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

Optional caller-owned HTTP client.

---

**Returns:** `RailOutcome`

An allow or block outcome.

**Raises:**

* `ValueError`: If `FIDDLER_API_KEY` is not set.

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