Skip to content

feat(apollo-react): show what a centralized guardrail reads on its row - #1461

Merged
apetraru-uipath merged 2 commits into
mainfrom
feat/centralized-guardrail-detection
Oct 23, 2026
Merged

apetraru-uipath merged 2 commits into
mainfrom
feat/centralized-guardrail-detection

Conversation

@apetraru-uipath

@apetraru-uipath apetraru-uipath commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

A centralized guardrail row now says what the guardrail reads. The row wording matches both products' own guardrail rows (UiPath/Agents#6782, UiPath/flow-workbench#5421):

Scope: LLM calls | Detection: Files | Execution stage: Pre-execution

It used to read Scopes: LLM calls · Execution stage: Pre-execution. The bars are aria-hidden; the row's accessible name is still its own text.

When Detection shows. Only on a built-in guardrail whose definition still offers the detectionScope parameter:

  • Agents stamps the policy's detection scope on every centralized prompt-attack, harmful-content, PII and judge guardrail, whatever the flags (AiTrustLayerGuardrailMapper).
  • The hosts strip the parameter from their definitions where file support is off. Agents strips it with withFileSupportParameters, Flow with applyGuardrailFileSupport. Both already pass the stripped definitions to this section.
  • In that case Agents' bulk validation reads no file at all, so the row leaves Detection out rather than claim one.
  • A BYO row, a validator without the parameter, and a section whose definitions are still loading show none.

The value. It is the policy's detectionScope, trimmed and case-insensitive. A missing, blank or unknown value reads Text, the way the gateway reads the policy; Both reads "Text, Files".

New exports:

  • getCentralizedGuardrailDetection(guardrail, definitions), typed structurally so both hosts' legacy rows can call it with their own types.
  • The type CentralizedDetectionDefinition.
  • findCentralizedBuiltInDefinition now accepts any definition with validator and byoValidatorName. This only widens its type.

New labels on CentralizedGuardrailsLabels:

Key English Message id
scope "Scope" guardrails.centralized.scope
detection "Detection" guardrails.centralized.detection
detectionText "Text" guardrails.centralized.detection-text
detectionFiles "Files" guardrails.centralized.detection-files
  • They are optional, like the detection-scope fallback keys, so a host's full labels table still type-checks.
  • They are added to en.json by hand. Other locales show English until the localization sync.
  • They are registered in centralized-parity.test.ts with both products' wording.

A separate docs(apollo-react) commit fixes the detection-scope default in the README and in getGuardrailDetectionScope's comment. Both still said the judge defaults to Both and that the backend falls back to the definition's default. That stopped being true with UiPath/Agents#6740.

Consumers: Agents frontend-sw and flow-workbench get this row by bumping to the release. Each host's legacy centralized row, used while its Apollo-components flag is off, then adopts the same line through getCentralizedGuardrailDetection. Those follow-ups are UiPath/Agents#6783 and UiPath/flow-workbench#5433, drafts on this PR's preview until the release.

Stories: "What each guardrail reads" (file support on) and "What each guardrail reads, file support off".

What each guardrail reads (file support on):

What each guardrail reads

File support off: the definitions no longer offer the parameter, so no row shows Detection.

File support off

How has this been tested?

  • vitest --run src/canvas/components/Guardrails: 46 files, 1104 tests pass. New cases cover:
    • the helper: Files, Both, Text, " files ", BOTH, Prompts, blank, a non-string, absent, parameters: null, definitions loading, a definition without the parameter, the wrong validator or a BYO definition, and a BYO guardrail;
    • the section: Files, Both, absent (Text), stripped, loading, BYO and sentiment rows, plus the aria-hidden separator;
    • the i18n-drift, parity and Japanese-catalog tests.
  • The full apollo-react suite: 4503 of 4504 pass. The one failure, formatDuration "keeps the cap in other locales (de, ja)", comes from this machine's Node locale data ("3 Std." against "3h"); this PR touches neither that test nor its code.
  • tsc --noEmit is clean; biome format and biome lint are clean apart from warnings already on main; pnpm run build passes.

Are there any breaking changes?

  • None: new optional labels and new exports, so a minor release

🤖 Generated with Claude Code

apetraru-uipath and others added 2 commits October 23, 2026 13:01
A centralized guardrail row now reads "Scope: LLM calls | Detection: Files |
Execution stage: Pre-execution", worded as both products' own guardrail rows.
Detection is the policy's detectionScope, or Text when it stored none, as the
gateway reads it; Both reads "Text, Files". It shows only on a built-in whose
definition still offers the parameter: hosts strip it where file support is
off, and then no file is read. BYO rows show none.

getCentralizedGuardrailDetection is exported so the hosts' legacy rows read it
the same way. The new labels are optional, like the detection scope fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lidator

The README and getGuardrailDetectionScope's comment still said the judge
defaults to Both and that the backend falls back to the definition's default.
Since the Agents change that made Text the default (UiPath/Agents pull 6740),
every definition defaults to Text and the backend reads an absent value as
Text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 10:06
@apetraru-uipath apetraru-uipath added the dev-packages Adds dev package publishing on pushes to this PR label Oct 23, 2026
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 23, 2026 10:07 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 23, 2026 10:07 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 23, 2026 10:07 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 23, 2026 10:07 Destroyed
@github-actions github-actions Bot added the size:L 100-499 changed lines. label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1957 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1721
ISC 91
Apache-2.0 57
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
CC0-1.0 4
MIT-0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The additive implementation matches the documented behavior, includes focused regression coverage, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds detection details to centralized guardrail rows in apollo-react, aligning their summaries with Agents and Flow while respecting host file-support settings.

Changes:

  • Shows Text, Files, or both only when a built-in definition offers detection scope.
  • Exports a reusable detection helper and adds optional localized labels.
  • Adds regression tests and stories, and corrects documentation about detection defaults without changing builder behavior.
File Description
packages/​apollo-react/​src/​canvas/​locales/​en.json Adds English summary labels.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​utils.ts Corrects the detection-default comment.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​README.md Documents row behavior and corrects default semantics.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​index.ts Exports the detection helper and structural type.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​i18n.ts Adds optional labels and their defaults.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​i18n.test.ts Checks legacy label-table compatibility.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​components/​centralized-guardrail-row.tsx Renders detection details and decorative separators.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-parity.test.ts Registers matching host wording.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-guardrails.stories.tsx Demonstrates file-support-enabled and disabled states.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-guardrails-section.tsx Resolves detection details for each row.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-guardrails-section.test.tsx Covers summaries, visibility conditions, and localization.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-guardrail-utils.ts Implements detection resolution and widens definition matching types.
packages/​apollo-react/​src/​canvas/​components/​Guardrails/​centralized-guardrail-utils.test.ts Covers normalization, fallbacks, and definition gating.

Review effort: Balanced

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📦 Dev Packages

🧹 Dev packages cleaned up after PR close.

Last updated: 2026-10-23 04:19:43 PT

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react 58.4% 75.0% (15/20) 8.14 MB 32.17 MB +308 B
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind — — 810.7 KB 4.68 MB +1 B
@uipath/ap-chat 85.8% — 40.42 MB 45.71 MB +20 B

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 25 changed, 4 added (of 676 compared, 647 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Oct 23, 2026, 03:36:56 AM

@apetraru-uipath
apetraru-uipath merged commit 1e5fb91 into main Oct 23, 2026
44 checks passed
@apetraru-uipath
apetraru-uipath deleted the feat/centralized-guardrail-detection branch October 23, 2026 11:17

This branch was successfully deployed

No deployments
preview/apollo-design — 40a37fa8 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-landing — 40a37fa8 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-vertex — 40a37fa8 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-docs — 40a37fa8 Deployed Oct 23, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-packages Adds dev package publishing on pushes to this PR pkg:apollo-react size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants