Skip to content

fix: pass None to rule evaluation when guardrail references missing field#1406

Merged
valentinabojan merged 2 commits intomainfrom
fix-guardrails
Mar 4, 2026
Merged

fix: pass None to rule evaluation when guardrail references missing field#1406
valentinabojan merged 2 commits intomainfrom
fix-guardrails

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

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime labels Mar 4, 2026
@valentinabojan valentinabojan merged commit 532c107 into main Mar 4, 2026
117 checks passed
@valentinabojan valentinabojan deleted the fix-guardrails branch March 4, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants