feat(guardrails): forward byoConnectionId for BYO guardrails#1817
Merged
Conversation
Add byo_connection_id (alias byoConnectionId) to BuiltInValidatorGuardrail and, for BYO guardrails, include it in the validate payload when present. The backend uses it to narrow BYOG configuration resolution to a specific connection (mirrors how a BYO model resolves). Resolution by validator name alone is unchanged when no connection id is set. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends BYO Guardrails (BYOG) evaluation to optionally forward a byoConnectionId alongside byoValidatorName, allowing the Agents backend to resolve connector-backed guardrail configuration scoped to a specific connection (matching BYO model resolution behavior).
Changes:
- Added
byo_connection_id(byoConnectionIdalias) toBuiltInValidatorGuardrailfor parsing fromagent.json. - Updated
GuardrailsService.evaluate_guardrailto includebyoConnectionIdin the validation payload for BYO guardrails when present. - Added/updated unit tests to validate forwarding, omission when absent, and alias parsing for
byoConnectionId.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/uipath-platform/src/uipath/platform/guardrails/guardrails.py | Adds typed model field for byoConnectionId parsing via Pydantic alias. |
| packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py | For BYO guardrails, conditionally forwards byoConnectionId in the validate request payload. |
| packages/uipath-platform/tests/services/test_guardrails_service.py | Adds tests for forwarding/omitting byoConnectionId and for alias parsing into the model field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lidator Addresses PR review: a regression test that byoConnectionId is dropped when validator_type != "byo" even if byo_connection_id is set, mirroring the existing byoValidatorName negative test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
apetraru-uipath
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Forwards an optional
byoConnectionIdwhen evaluating a BYO guardrail, so the Agents backend can narrow BYOG configuration resolution to a specific connection — parity with how a BYO model is resolved by connection.Changes
BuiltInValidatorGuardrailgainsbyo_connection_id(aliasbyoConnectionId), parsed fromagent.json.validator_type == "byo"), the validate payload includesbyoConnectionIdwhen present, alongside the existingbyoValidatorName.Behavior
Backward compatible: when no connection id is set, resolution falls back to validator name alone (unchanged). Follows the byoValidatorName support merged in #1810.
Backend dependency
Paired with the Agents change (UiPath/Agents#5816) which accepts
byoConnectionIdand uses it as a narrowing filter; validator names there are now unique per connection.Tests
test_guardrails_service.py: forwards connection id when set, omits when absent, parses the alias (26 pass).🤖 Generated with Claude Code