Guardrails
GuardrailsService ¶
Service for validating text against UiPath Guardrails.
This service provides an interface for evaluating built-in guardrails such as:
- PII detection
- Prompt injection detection
Deterministic and custom guardrails are not yet supported.
Version Availability
This service is available starting from uipath version 2.2.12.
evaluate_guardrail ¶
Validate input text using the provided guardrail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data
|
str | dict[str, Any]
|
The text or structured data to validate. Dictionaries will be converted to a string before validation. |
required |
guardrail
|
Guardrail
|
A guardrail instance used for validation. Must be an instance of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BuiltInGuardrailValidationResult |
GuardrailValidationResult
|
The outcome of the guardrail evaluation, containing whether validation passed and the reason. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If a non-built-in guardrail is provided. |