From 7d2a8717794cf75aed367eb4e059df0a97fe9261 Mon Sep 17 00:00:00 2001 From: Andrei Petraru Date: Mon, 3 Aug 2026 19:36:47 +0300 Subject: [PATCH] docs(guardrails): document ByoValidator on the core guardrails page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ByoValidator` ships in `uipath.platform.guardrails` (exported at the top level, same as every other validator) but the core guardrails page never picked up a section for it, so the only rendered documentation of BYOG is the LangChain adapter page. Readers of the core page reasonably conclude Bring Your Own Guardrail is LangChain-only — it isn't; the validator is framework-agnostic and the LangChain package merely re-exports it. Add a `### Bring Your Own Guardrail (BYOG)` section alongside the other built-in validators, following the same shape as its siblings: what it does, the all-stages note, the admin prerequisite, a runnable example, and the two parameters. Also list `ByoValidator` in the execution-stages table under `PRE_AND_POST`. Verified against the source: import path, positional `validator_name`, keyword-only `parameters`, `validator_type == "byo"`, serialization to `byoValidatorName`, and the empty-name `ValueError` all behave as written. Docs only. --- packages/uipath/docs/core/guardrails.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/uipath/docs/core/guardrails.md b/packages/uipath/docs/core/guardrails.md index 6a220bfe2..f59b67c3f 100644 --- a/packages/uipath/docs/core/guardrails.md +++ b/packages/uipath/docs/core/guardrails.md @@ -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 @@ -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.