Repository navigation
feat(apollo-react): show what a centralized guardrail reads on its row - #1461
Conversation
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>
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
🟢 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
📦 Dev Packages🧹 Dev packages cleaned up after PR close. Last updated: 2026-10-23 04:19:43 PT |
📊 Coverage + size by packagePer-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
"Coverage" is each package's own |
Storybook visual diffBaseline 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 |
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-executionIt used to read
Scopes: LLM calls · Execution stage: Pre-execution. The bars arearia-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
detectionScopeparameter:AiTrustLayerGuardrailMapper).withFileSupportParameters, Flow withapplyGuardrailFileSupport. Both already pass the stripped definitions to this section.definitionsare 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;Bothreads "Text, Files".New exports:
getCentralizedGuardrailDetection(guardrail, definitions), typed structurally so both hosts' legacy rows can call it with their own types.CentralizedDetectionDefinition.findCentralizedBuiltInDefinitionnow accepts any definition withvalidatorandbyoValidatorName. This only widens its type.New labels on
CentralizedGuardrailsLabels:scopeguardrails.centralized.scopedetectionguardrails.centralized.detectiondetectionTextguardrails.centralized.detection-textdetectionFilesguardrails.centralized.detection-filesen.jsonby hand. Other locales show English until the localization sync.centralized-parity.test.tswith both products' wording.A separate
docs(apollo-react)commit fixes the detection-scope default in the README and ingetGuardrailDetectionScope'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):
File support off: the definitions no longer offer the parameter, so no row shows Detection.
How has this been tested?
vitest --run src/canvas/components/Guardrails: 46 files, 1104 tests pass. New cases cover:" 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;aria-hiddenseparator;apollo-reactsuite: 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 --noEmitis clean;biome formatandbiome lintare clean apart from warnings already on main;pnpm run buildpasses.Are there any breaking changes?
🤖 Generated with Claude Code