feat(guardrails): forward byoValidatorName in evaluation for BYOG#1810
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the uipath-platform runtime SDK guardrails flow to support Bring-Your-Own-Guardrail (BYOG) execution by carrying the connector configuration reference (byoValidatorName) through the typed model and into the /validate request payload, aligning the SDK with the backend contract.
Changes:
- Add a typed
byo_validator_namefield (aliasbyoValidatorName) toBuiltInValidatorGuardrail. - Forward
byoValidatorNameinGuardrailsService.evaluate_guardrailwhen present, leaving OOTB validator payloads unchanged. - Add targeted tests and bump
uipath-platformversion0.2.8 → 0.2.9(plus lockfile updates).
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath/uv.lock | Bumps uipath-platform to 0.2.9 in the workspace lock. |
| packages/uipath-platform/uv.lock | Updates platform lockfile to 0.2.9 and regenerated lock metadata. |
| packages/uipath-platform/tests/services/test_guardrails_service.py | Adds tests for BYOG forwarding, alias parsing, and OOTB omission behavior. |
| packages/uipath-platform/src/uipath/platform/guardrails/guardrails.py | Adds typed byo_validator_name field with camelCase alias. |
| packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py | Adds byoValidatorName to the /validate payload when set. |
| packages/uipath-platform/pyproject.toml | Version bump to 0.2.9. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
22dc1c9 to
451d49e
Compare
258548e to
54718e3
Compare
Bring-Your-Own-Guardrail (BYOG) guardrails are represented as a BuiltInValidatorGuardrail with the "byo" sentinel validator_type and a byoValidatorName referencing the connector-backed configuration. Add the typed field and forward byoValidatorName in the evaluation request so the guardrails service can resolve and dispatch to the connector, and fail fast when a "byo" guardrail is missing the reference. Built-in validators are unchanged. Bumps uipath-platform to 0.2.9. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
54718e3 to
abd5a4b
Compare
|
🚨 Heads up:
|



What changed?
Adds support for evaluating Bring-Your-Own-Guardrail (BYOG) guardrails — guardrails backed by a customer-provided Integration Service connector rather than a UiPath built-in validator.
A BYOG guardrail is represented as a
BuiltInValidatorGuardrailwhosevalidatorTypeis the"byo"sentinel, with the connector-backed configuration referenced by a separatebyoValidatorName. The guardrails service resolves the configuration by that name at evaluation time, so the SDK must send it. Previously the name was not forwarded, so a BYOG guardrail reached the service without its reference and could not be dispatched.BuiltInValidatorGuardrail— new typedbyo_validator_name: str | Nonefield (aliasbyoValidatorName), plus aBYO_VALIDATOR_TYPEsentinel constant.GuardrailsService.evaluate_guardrail— forwardsbyoValidatorNamein the validation request for"byo"guardrails, and fails fast with aValueErrorif a"byo"guardrail is missing the reference (an unresolvable request). Built-in validator payloads are unchanged.uipath-platform0.2.8 → 0.2.9(+ lockfiles).Why
Without forwarding the reference, the guardrails service cannot resolve which connector-backed configuration to dispatch to, so BYOG guardrails cannot execute. This is additive: built-in validators are entirely unaffected (the key is only added for
"byo"guardrails).Tests
packages/uipath-platform/tests/services/test_guardrails_service.py:byoValidatorNamein the request"byo"guardrail with no reference raisesValueErrorbyoValidatorNameparses into the typed field via its camelCase aliasbyovalidator with the field set does not forward the keybyoValidatorName(payload unchanged)All guardrails-service tests pass (23); ruff + mypy clean on changed files.
Are there any breaking changes?
🤖 Generated with Claude Code