Skip to content

feat(guardrails): resolve BYOG by validator name only [AL-510] - #1840

Merged
apetraru-uipath merged 1 commit into
mainfrom
feat/byog-name-only
Aug 3, 2026
Merged

feat(guardrails): resolve BYOG by validator name only [AL-510]#1840
apetraru-uipath merged 1 commit into
mainfrom
feat/byog-name-only

Conversation

@apetraru-uipath

Copy link
Copy Markdown
Contributor

What changed?

The Agents backend now enforces BYOG validator-name uniqueness per tenant and no longer accepts a connection id at validation nor persists one in the agent (UiPath/Agents#5959, AL-510): the name alone resolves the configuration, and the Integration Service connection is taken from it server-side — an admin rebind is always honored. This PR removes the now-dead connection id from the coded-agents surface.

  • BuiltInValidatorGuardrail — the byo_connection_id field is removed. Legacy json carrying byoConnectionId still parses (extra="allow") but the value is inert; a compat test pins that it is never forwarded to the service.
  • GuardrailsService.evaluate_guardrail — stops forwarding byoConnectionId; the byo payload carries byoValidatorName only.
  • ByoValidator — the connection_id kwarg is removed; the docstring now states names are unique per tenant, and the example loses the (real, tenant-specific) connection id it still embedded.
  • Versionuipath-platform 0.2.17, both lockfiles synced.

Version-skew safety: published uipath-langchain releases (0.14.18–0.14.20) still pass byo_connection_id= when constructing the model — with extra="allow" that lands as an inert extra attribute the service never reads, and the server ignores the JSON field anyway. All old/new combinations are safe; no coordinated release needed.

How has this been tested?

  • test_guardrails_service.py: the BYOG payload contains byoValidatorName and no byoConnectionId — including when a legacy byoConnectionId is present on the parsed model, and for non-byo validator types; legacy-json parse compat pinned.
  • test_guardrails_decorators.py: ByoValidator name-only construction, wire serialization (asserts byoConnectionId absent from the dump), parameter passthrough, run-forwarding.
  • Full uipath-platform package suite green; ruff check, ruff format --check, mypy src tests clean; uv lock --check clean in both affected packages.

Are there any breaking changes?

  • Under Feature Flag
  • API removals
  • None
  • DB migrations

ByoValidator(connection_id=...) from 0.2.14–0.2.16 now raises TypeError, and BuiltInValidatorGuardrail.byo_connection_id is no longer a typed field. Both shipped days ago (July 29), and the server already ignores the field they fed — deliberate hard removal in agreement with the backend change rather than a deprecation shim.

🤖 Generated with Claude Code

The Agents backend now enforces BYOG validator-name uniqueness per tenant
and no longer accepts a connection id at validation nor persists one in the
agent (UiPath/Agents#5959): the name alone resolves the configuration and
the Integration Service connection is taken from it server-side, so an
admin rebind is always honored.

Remove the connection id from the coded-agents surface accordingly:

- BuiltInValidatorGuardrail: drop the byo_connection_id field. Legacy json
  carrying byoConnectionId still parses (extra="allow") but the value is
  inert - covered by a compat test asserting it is never forwarded.
- GuardrailsService.evaluate_guardrail: stop forwarding byoConnectionId;
  the byo payload carries byoValidatorName only.
- ByoValidator: remove the connection_id kwarg; docstring now states names
  are unique per tenant and drops the (real, tenant-specific) connection id
  that was still embedded in the example.
- Tests updated: name-only construction/serialization/forwarding, plus the
  legacy-field compat pins.
- Bump uipath-platform to 0.2.17, both lockfiles synced.

Breaking only in the narrow sense that ByoValidator(connection_id=...) from
0.2.14-0.2.16 now raises TypeError; the parameter shipped days ago and the
server already ignores the field it fed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 3, 2026 16:37
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Aug 3, 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 aligns the Python SDK’s BYOG (Bring Your Own Guardrail) support with the Agents backend change that resolves BYOG configuration by validator name only (per tenant), removing the now-dead Integration Service connection-id from the SDK surface and ensuring it is never sent over the wire.

Changes:

  • Removed byo_connection_id from BuiltInValidatorGuardrail and stopped forwarding byoConnectionId in GuardrailsService.evaluate_guardrail.
  • Updated ByoValidator to be name-only (removed connection_id kwarg) and refreshed docstring/example accordingly.
  • Updated/added tests to pin legacy JSON parsing behavior while asserting byoConnectionId is never forwarded; bumped uipath-platform to 0.2.17 and synced lockfiles.

Reviewed changes

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

Show a summary per file
File Description
packages/uipath/uv.lock Updates locked editable uipath-platform version to 0.2.17.
packages/uipath-platform/uv.lock Updates locked package version to 0.2.17.
packages/uipath-platform/tests/services/test_guardrails_service.py Verifies BYOG payload includes only byoValidatorName and never forwards legacy byoConnectionId; pins legacy parse behavior.
packages/uipath-platform/tests/services/test_guardrails_decorators.py Updates decorator-layer tests for name-only ByoValidator and asserts byoConnectionId is absent from dumps.
packages/uipath-platform/src/uipath/platform/guardrails/guardrails.py Removes typed byo_connection_id field while retaining legacy-json tolerance via extra="allow".
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/byo.py Removes connection_id kwarg and updates docs/example to validator-name-only semantics.
packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py Stops adding byoConnectionId to the evaluation request payload.
packages/uipath-platform/pyproject.toml Bumps uipath-platform version to 0.2.17.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@apetraru-uipath
apetraru-uipath merged commit c58d485 into main Aug 3, 2026
95 checks passed
@apetraru-uipath
apetraru-uipath deleted the feat/byog-name-only branch August 3, 2026 19:00
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