Skip to content

feat(guardrails): forward byoConnectionId for BYO guardrails#1817

Merged
valentinabojan merged 5 commits into
mainfrom
valentinabojan/byog-forward-connection-id
Jul 15, 2026
Merged

feat(guardrails): forward byoConnectionId for BYO guardrails#1817
valentinabojan merged 5 commits into
mainfrom
valentinabojan/byog-forward-connection-id

Conversation

@valentinabojan

Copy link
Copy Markdown
Contributor

What

Forwards an optional byoConnectionId when 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

  • BuiltInValidatorGuardrail gains byo_connection_id (alias byoConnectionId), parsed from agent.json.
  • For a BYO guardrail (validator_type == "byo"), the validate payload includes byoConnectionId when present, alongside the existing byoValidatorName.

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 byoConnectionId and 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

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>
Copilot AI review requested due to automatic review settings July 15, 2026 11:11
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jul 15, 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 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 (byoConnectionId alias) to BuiltInValidatorGuardrail for parsing from agent.json.
  • Updated GuardrailsService.evaluate_guardrail to include byoConnectionId in 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.

Valentina Bojan and others added 4 commits July 15, 2026 14:30
…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>
@sonarqubecloud

Copy link
Copy Markdown

@valentinabojan
valentinabojan merged commit e2ab6f7 into main Jul 15, 2026
164 checks passed
@valentinabojan
valentinabojan deleted the valentinabojan/byog-forward-connection-id branch July 15, 2026 13:22
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