Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

fix: pass validation when guardrail rule references missing field#48

Open
valentinabojan wants to merge 1 commit intomainfrom
fix/missing-field-guardrail-validation
Open

fix: pass validation when guardrail rule references missing field#48
valentinabojan wants to merge 1 commit intomainfrom
fix/missing-field-guardrail-validation

Conversation

@valentinabojan
Copy link
Contributor

Summary

  • When a guardrail rule references a field that doesn't exist in the input/output data, validation now correctly passes instead of incorrectly failing
  • Added early return if not fields in evaluate_word_rule, evaluate_number_rule, and evaluate_boolean_rule
  • Previously, the empty field list caused the evaluator loop to be skipped, falling through to the "violation detected" return

Test plan

  • Added tests for all three rule types (word, number, boolean) with missing fields
  • All 36 existing tests still pass

🤖 Generated with Claude Code

@valentinabojan valentinabojan force-pushed the fix/missing-field-guardrail-validation branch 2 times, most recently from 3af69fd to 3b105ef Compare March 4, 2026 14:25
@valentinabojan valentinabojan force-pushed the fix/missing-field-guardrail-validation branch 5 times, most recently from c80c42c to d9b6866 Compare March 4, 2026 15:22
…ield

When a rule references a field that doesn't exist in the data,
pass None as the value to detects_violation so the rule lambda
can decide the outcome. Previously, missing fields caused the
evaluator loop to be skipped entirely, incorrectly treating
the rule as violated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@valentinabojan valentinabojan force-pushed the fix/missing-field-guardrail-validation branch from d9b6866 to feb2cc3 Compare March 4, 2026 15:22
@cristipufu
Copy link
Member

@valentinabojan please port these changes over to uipath-python after we merge this PR UiPath/uipath-python#1403

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants