Skip to content

Commit 6f1394b

Browse files
fix(uipath-agents): update guardrails guide with new validators and corrections (#440)
* fix(uipath-agents): update guardrails guide with new validators, operators, and corrections - Add validators quick reference table (pii_detection, prompt_injection, harmful_content, intellectual_property, user_prompt_attacks) - Add missing string operators (notStartsWith, notEndsWith, isEmpty, isNotEmpty) - Add examples for user_prompt_attacks and intellectual_property validators - Fix applyTo enum value: "both" → "inputAndOutput" - Fix harmfulContentEntityThresholds to use valid even severity values (0/2/4/6) - Add critical rules for filter action support and threshold values - Remove "masks" from filter action description (filter only removes fields) Closes AL-368 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(uipath-agents): filter action only supported on custom rules, not built-in validators Built-in validators (pii_detection, intellectual_property, etc.) only support block, log, and escalate. Filter is exclusive to customWordRule. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(uipath-agents): use "deterministic rules" instead of "customWordRule" in critical rule 14 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(uipath-agents): correct guardrail operator names to match validation Word operators: notContains→doesNotContain, notEquals→doesNotEqual, notStartsWith→doesNotStartWith, notEndsWith→doesNotEndWith. Number operators: notEquals→doesNotEqual. Also trim matchNames description. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 03b7d85 commit 6f1394b

1 file changed

Lines changed: 82 additions & 16 deletions

File tree

skills/uipath-agents/references/lowcode/guardrails-guide.md

Lines changed: 82 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The `selector` field controls where the guardrail applies.
3838
| Field | Type | Required | Description |
3939
|-------|------|----------|-------------|
4040
| `scopes` | string[] | Yes | Array of `"Agent"`, `"Llm"`, `"Tool"` — at least one required |
41-
| `matchNames` | string[] | No | Target specific tools by name. Omit to apply to all tools in the selected scopes |
41+
| `matchNames` | string[] | No | Target specific tools by name. |
4242

4343
### Scope Definitions
4444

@@ -102,7 +102,7 @@ Records the violation in logs without stopping execution.
102102

103103
### filter — Redact Fields
104104

105-
Removes or masks specific fields from the input/output.
105+
Removes specific fields from the input/output.
106106

107107
```json
108108
"action": {
@@ -207,8 +207,12 @@ String matching against field values.
207207
| `startsWith` | Field value starts with the string |
208208
| `endsWith` | Field value ends with the string |
209209
| `matchesRegex` | Field value matches the regular expression |
210-
| `notContains` | Field value does not contain the string |
211-
| `notEquals` | Field value does not equal the string |
210+
| `doesNotContain` | Field value does not contain the string |
211+
| `doesNotEqual` | Field value does not equal the string |
212+
| `doesNotStartWith` | Field value does not start with the string |
213+
| `doesNotEndWith` | Field value does not end with the string |
214+
| `isEmpty` | Field value is empty (no `value` needed) |
215+
| `isNotEmpty` | Field value is not empty (no `value` needed) |
212216

213217
#### Number Rules (`$ruleType: "number"`)
214218

@@ -221,7 +225,7 @@ Numeric comparison against field values.
221225
| `operator` | string | Yes | Comparison operator |
222226
| `value` | number | Yes | Value to compare against |
223227

224-
**Operators:** `equals`, `notEquals`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`
228+
**Operators:** `equals`, `doesNotEqual`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`
225229

226230
#### Boolean Rules (`$ruleType: "boolean"`)
227231

@@ -236,12 +240,12 @@ Boolean equality check.
236240

237241
#### Always / Universal Rules (`$ruleType: "always"`)
238242

239-
Fires on every input/output — no condition check. Use `applyTo` to control whether it runs on input, output, or both.
243+
Fires on every input/output — no condition check. Use `applyTo` to control whether it runs on input, output, or inputAndOutput.
240244

241245
| Field | Type | Required | Description |
242246
|-------|------|----------|-------------|
243247
| `$ruleType` | `"always"` | Yes | Rule type discriminator |
244-
| `applyTo` | `"input"` \| `"output"` \| `"both"` | Yes | When the rule fires |
248+
| `applyTo` | `"input"` \| `"output"` \| `"inputAndOutput"` | Yes | When the rule fires |
245249

246250
### Field Selectors
247251

@@ -307,9 +311,17 @@ Built-in validators call the UiPath Guardrails API. They have a `validatorType`
307311
| `"map-enum"` | Threshold maps (e.g., `entityThresholds`, `harmfulContentEntityThresholds`) | object (keys = entity names, values = numbers) |
308312
| `"number"` | Scalar numbers (e.g., `threshold` for prompt injection) | number |
309313

310-
### Validators Reference
314+
### Validators Quick Reference
311315

312-
Run `uip agent guardrails list --output json` to get the full list of available validators with their allowed scopes, stages, and parameters. Use the output to populate `validatorType`, `selector.scopes`, and `validatorParameters` fields.
316+
| Validator | Scopes | Stages | Supported Actions |
317+
|-----------|--------|--------|-------------------|
318+
| `pii_detection` | Agent, Llm, Tool | Pre + Post | Block, Log, Escalate |
319+
| `prompt_injection` | Llm | Pre only | Block, Log, Escalate |
320+
| `harmful_content` | Agent, Llm, Tool | Pre + Post | Block, Log, Escalate |
321+
| `intellectual_property` | Llm, Agent | Post only | Block, Log, Escalate |
322+
| `user_prompt_attacks` | Llm | Pre only | Block, Log, Escalate |
323+
324+
Run `uip agent guardrails list --output json` to get the authoritative list. Use the output to populate `validatorType`, `selector.scopes`, and `validatorParameters` fields.
313325

314326
**How to map `uip agent guardrails list` output to guardrail JSON:**
315327

@@ -381,10 +393,10 @@ Run `uip agent guardrails list --output json` to get the full list of available
381393
"$parameterType": "map-enum",
382394
"id": "harmfulContentEntityThresholds",
383395
"value": {
384-
"Hate": 3,
396+
"Hate": 2,
385397
"SelfHarm": 2,
386398
"Sexual": 4,
387-
"Violence": 3
399+
"Violence": 2
388400
}
389401
}
390402
],
@@ -426,7 +438,59 @@ Run `uip agent guardrails list --output json` to get the full list of available
426438
}
427439
```
428440

429-
### Example 4: Custom Word Rule — Block Forbidden Terms in Specific Tool Output
441+
### Example 4: User Prompt Attack Detection — Block Jailbreaks
442+
443+
No parameters required — binary detection via Azure Prompt Shield. Llm PreExecution only.
444+
445+
```json
446+
{
447+
"$guardrailType": "builtInValidator",
448+
"id": "f1a2b3c4-d5e6-7890-abcd-ef0123456789",
449+
"name": "User prompt attack guardrail",
450+
"description": "Detects jailbreak attempts and indirect prompt injection via Azure Prompt Shield",
451+
"validatorType": "user_prompt_attacks",
452+
"validatorParameters": [],
453+
"action": {
454+
"$actionType": "block",
455+
"reason": "Adversarial input detected — execution blocked."
456+
},
457+
"enabledForEvals": true,
458+
"selector": {
459+
"scopes": ["Llm"]
460+
}
461+
}
462+
```
463+
464+
### Example 5: Intellectual Property Detection — Block Copyrighted Text and Code
465+
466+
PostExecution only — no content exists to check before the LLM generates output.
467+
468+
```json
469+
{
470+
"$guardrailType": "builtInValidator",
471+
"id": "a2b3c4d5-e6f7-8901-bcde-f01234567890",
472+
"name": "IP detection guardrail",
473+
"description": "Detects copyrighted text and licensed GitHub code in LLM output",
474+
"validatorType": "intellectual_property",
475+
"validatorParameters": [
476+
{
477+
"$parameterType": "enum-list",
478+
"id": "ipEntities",
479+
"value": ["Text", "Code"]
480+
}
481+
],
482+
"action": {
483+
"$actionType": "block",
484+
"reason": "Protected material detected in output — execution blocked."
485+
},
486+
"enabledForEvals": true,
487+
"selector": {
488+
"scopes": ["Llm"]
489+
}
490+
}
491+
```
492+
493+
### Example 6: Custom Word Rule — Block Forbidden Terms in Specific Tool Output
430494

431495
```json
432496
{
@@ -462,7 +526,7 @@ Run `uip agent guardrails list --output json` to get the full list of available
462526
}
463527
```
464528

465-
### Example 5: Custom Word Rule — Log on All Fields
529+
### Example 7: Custom Word Rule — Log on All Fields
466530

467531
```json
468532
{
@@ -491,7 +555,7 @@ Run `uip agent guardrails list --output json` to get the full list of available
491555
}
492556
```
493557

494-
### Example 6: Escalate PII Violations to Action Center — Multiple Tool Targets
558+
### Example 8: Escalate PII Violations to Action Center — Multiple Tool Targets
495559

496560
Escalates to an Action Center app when PII is detected in output from specific tools. Uses `matchNames` to target multiple tools and `escalate` action with `app` and `recipient`.
497561

@@ -540,7 +604,7 @@ Escalates to an Action Center app when PII is detected in output from specific t
540604
}
541605
```
542606

543-
### Example 7: Custom Word Rule — Specific Fields with Titles on a Named Tool
607+
### Example 9: Custom Word Rule — Specific Fields with Titles on a Named Tool
544608

545609
Inspects specific output fields (with human-readable `title`) of an Integration Service tool. Logs a violation when the field value contains a forbidden string.
546610

@@ -584,7 +648,7 @@ Inspects specific output fields (with human-readable `title`) of an Integration
584648
}
585649
```
586650

587-
### Example 8: Filter — Redact Fields from Tool Output
651+
### Example 10: Filter — Redact Fields from Tool Output
588652

589653
Redacts specific fields from a tool's output instead of blocking or logging. Use when you want the agent to continue but with sensitive data removed.
590654

@@ -663,3 +727,5 @@ Add the `guardrails` array at the agent.json root level alongside `settings`, `m
663727
11. **Do not forget `matchNames` when targeting a specific tool** — without it, the guardrail applies to all tools in the scope.
664728
12. **Do not manually edit `guardrail.policies` on tool resources** — it is auto-populated by `uip agent validate` from root-level guardrails. Always configure guardrails at the agent.json root `guardrails` array.
665729
13. **Do not reuse UUIDs across guardrails** — each guardrail needs a unique `id`.
730+
14. **Do not use `filter` action on built-in validators**`"$actionType": "filter"` is only supported on deterministic rules. All built-in validators (`pii_detection`, `intellectual_property`, `prompt_injection`, `user_prompt_attacks`, `harmful_content`) support only `block`, `log`, and `escalate`.
731+
15. **Do not use odd numbers or floats for `harmfulContentEntityThresholds`** — only `0`, `2`, `4`, `6` are valid severity values. Values like `3` or `2.5` cause validation errors.

0 commit comments

Comments
 (0)