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

## Module Contents

### Functions

| Name                                                                                | Description                                                             |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [`_create_http_client`](#nemoguardrails-library-f5-actions-_create_http_client)     | -                                                                       |
| [`_fail_open_outcome`](#nemoguardrails-library-f5-actions-_fail_open_outcome)       | Outcome returned when the API is unreachable and fail\_open is enabled. |
| [`_get_f5_config`](#nemoguardrails-library-f5-actions-_get_f5_config)               | -                                                                       |
| [`_retry_policy`](#nemoguardrails-library-f5-actions-_retry_policy)                 | -                                                                       |
| [`_retrying_http_client`](#nemoguardrails-library-f5-actions-_retrying_http_client) | -                                                                       |
| [`_scan_outcome`](#nemoguardrails-library-f5-actions-_scan_outcome)                 | -                                                                       |
| [`f5_guardrails_scan`](#nemoguardrails-library-f5-actions-f5_guardrails_scan)       | Scans the provided text using the F5 Guardrails API.                    |

### Data

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

### API

```python
nemoguardrails.library.f5.actions._create_http_client(
    f5_config: nemoguardrails.rails.llm.config.F5GuardrailsRailConfig
) -> nemoguardrails.http.HTTPClient
```

```python
nemoguardrails.library.f5.actions._fail_open_outcome() -> nemoguardrails.actions.rail_outcome.RailOutcome
```

Outcome returned when the API is unreachable and fail\_open is enabled.

The `fail_open` marker makes this distinguishable from a real cleared
scan in logs and traces.

```python
nemoguardrails.library.f5.actions._get_f5_config(
    config: typing.Optional[nemoguardrails.rails.llm.config.RailsConfig]
) -> nemoguardrails.rails.llm.config.F5GuardrailsRailConfig
```

```python
nemoguardrails.library.f5.actions._retry_policy(
    f5_config: nemoguardrails.rails.llm.config.F5GuardrailsRailConfig
) -> nemoguardrails.http.RetryPolicy
```

```python
nemoguardrails.library.f5.actions._retrying_http_client(
    client: nemoguardrails.http.HTTPClient,
    f5_config: nemoguardrails.rails.llm.config.F5GuardrailsRailConfig
) -> nemoguardrails.http.HTTPClient
```

```python
nemoguardrails.library.f5.actions._scan_outcome(
    result: dict
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

```python
nemoguardrails.library.f5.actions.f5_guardrails_scan(
    text: str,
    config: typing.Optional[nemoguardrails.rails.llm.config.RailsConfig] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None,
    kwargs: typing.Any = {}
) -> nemoguardrails.actions.rail_outcome.RailOutcome
```

async

Scans the provided text using the F5 Guardrails API.

On HTTP 429 responses the action honors the `Retry-After` header
(delta-seconds or HTTP-date) up to
`rails.config.f5.max_retry_after_seconds` and retries up to
`rails.config.f5.max_retries` additional times before applying the
configured fail\_open / fail\_closed behavior.

**Parameters:**

**`text`** `str`

The text to scan.

---

**`config`** `Optional[RailsConfig]` — default: None

The active RailsConfig; used to resolve `rails.config.f5`.

---

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

Optional caller-owned HTTP client used with the F5 retry
policy. The action does not close an injected client.

---

**Returns:** `RailOutcome`

The rail decision with the F5 Guardrails API response as metadata.

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