Skip to content

feat(guardrails): forward byoValidatorName in evaluation for BYOG#1810

Merged
valentinabojan merged 1 commit into
mainfrom
valentinabojan/byog-evaluate-validator-name
Jul 13, 2026
Merged

feat(guardrails): forward byoValidatorName in evaluation for BYOG#1810
valentinabojan merged 1 commit into
mainfrom
valentinabojan/byog-evaluate-validator-name

Conversation

@valentinabojan

@valentinabojan valentinabojan commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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 BuiltInValidatorGuardrail whose validatorType is the "byo" sentinel, with the connector-backed configuration referenced by a separate byoValidatorName. 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 typed byo_validator_name: str | None field (alias byoValidatorName), plus a BYO_VALIDATOR_TYPE sentinel constant.
  • GuardrailsService.evaluate_guardrail — forwards byoValidatorName in the validation request for "byo" guardrails, and fails fast with a ValueError if a "byo" guardrail is missing the reference (an unresolvable request). Built-in validator payloads are unchanged.
  • Version bump uipath-platform 0.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:

  • BYOG guardrail forwards byoValidatorName in the request
  • a "byo" guardrail with no reference raises ValueError
  • byoValidatorName parses into the typed field via its camelCase alias
  • a non-byo validator with the field set does not forward the key
  • built-in validators omit byoValidatorName (payload unchanged)

All guardrails-service tests pass (23); ruff + mypy clean on changed files.

Are there any breaking changes?

  • Under Feature Flag
  • None (additive; built-in validator payloads unchanged)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 13, 2026 14:16
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_name field (alias byoValidatorName) to BuiltInValidatorGuardrail.
  • Forward byoValidatorName in GuardrailsService.evaluate_guardrail when present, leaving OOTB validator payloads unchanged.
  • Add targeted tests and bump uipath-platform version 0.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.

Comment thread packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py Outdated
@valentinabojan valentinabojan force-pushed the valentinabojan/byog-evaluate-validator-name branch from 22dc1c9 to 451d49e Compare July 13, 2026 14:19
@valentinabojan valentinabojan requested a review from Copilot July 13, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Comment thread packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Comment thread packages/uipath-platform/src/uipath/platform/guardrails/guardrails.py Outdated
@valentinabojan valentinabojan force-pushed the valentinabojan/byog-evaluate-validator-name branch from 258548e to 54718e3 Compare July 13, 2026 15:44
@valentinabojan valentinabojan requested a review from Copilot July 13, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated no new comments.

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>
@valentinabojan valentinabojan force-pushed the valentinabojan/byog-evaluate-validator-name branch from 54718e3 to abd5a4b Compare July 13, 2026 15:48
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@valentinabojan valentinabojan merged commit 9e44d4b into main Jul 13, 2026
165 checks passed
@valentinabojan valentinabojan deleted the valentinabojan/byog-evaluate-validator-name branch July 13, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants