Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion packages/uipath/docs/core/guardrails.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The `stage` parameter controls when the guardrail evaluates. Not all validators
|-------|---------------|--------------|
| `PRE` | Before the function runs | All validators |
| `POST` | After the function runs | All except `UserPromptAttacksValidator` |
| `PRE_AND_POST` | Both before and after | `PIIValidator`, `HarmfulContentValidator`, `LLMAsJudgeValidator`, `CustomValidator` |
| `PRE_AND_POST` | Both before and after | `PIIValidator`, `HarmfulContentValidator`, `LLMAsJudgeValidator`, `CustomValidator`, `ByoValidator` |

## Built-in Validators

Expand Down Expand Up @@ -242,6 +242,25 @@ def answer_question(question: str) -> str:
- `threshold` — strictness from `0` (strictest) to `6` (most lenient), defaulting to `2`. Higher values flag only clear violations.
- `positive_examples` / `negative_examples` — optional example payloads (not descriptions) that comply with / violate the rule, used to calibrate the judge. At most 2 entries per list, each at most 1000 characters.

### Bring Your Own Guardrail (BYOG)

Runs a customer-managed validator instead of a UiPath-managed one — your own Azure Content Safety subscription, a vendor connector, or a custom Integration Service connector. Supported at all stages: BYO validator capabilities are connector-defined and cannot be known statically, so no stage restriction is applied.

An Org Admin first creates the configuration under **Admin → AI Trust Layer → Guardrails Configurations** and saves it with a validator name. The validator references that configuration by name alone — names are unique per tenant, and the Integration Service connection is resolved server-side from the configuration, so an admin rebind is always honored.

```python
from uipath.platform.guardrails import BlockAction, ByoValidator, guardrail

byog_harmful_content = ByoValidator("my-harmful-content-guardrail")

@guardrail(validator=byog_harmful_content, action=BlockAction())
def summarize(text: str) -> str:
...
```

- `validator_name` (required, positional) — the configuration's validator name (`byoValidatorName`), as shown in Admin → AI Trust Layer → Guardrails Configurations.
- `parameters` — optional list of validator parameters. BYO parameter schemas are connector-defined, so values are passed through as-is; read the ids and allowed values from the validator's `Parameters` schema.

## Actions

Actions define what happens when a violation is detected.
Expand Down
Loading