Skip to content

Conversation

@valentinabojan
Copy link
Contributor

@valentinabojan valentinabojan commented Jan 20, 2026

Apply multiple fixes regarding deterministic guardrails evaluation:

  • fail guardrail validation only when ALL rules are violated
  • fail deterministic rule only when ALL fields violate the rule
  • add rule_description to be used to display or log human readable interpretation of the rule
  • slightly change the validation result messages

@valentinabojan valentinabojan force-pushed the guardrails_validation_messages branch 2 times, most recently from f34cb78 to f9496a3 Compare January 20, 2026 13:56
if violation_detected:
operator = (
_humanize_guardrail_func(rule.detects_violation) or "violation check"
if not violation_detected:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If any of the fields don't violate the guardrail condition, then the validation should pass

return True, reason

return True, "All word rule validations passed"
return False, get_validated_conditions_description(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only when all fields violate the guardrail condition, then the validation should fail


if not passed:
validated_conditions.append(reason)
if passed:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If any of the rules is not violated, then the validation should pass

return GuardrailValidationResult(
result=GuardrailValidationResultType.PASSED,
reason="All deterministic guardrail rules passed",
result=GuardrailValidationResultType.VALIDATION_FAILED,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only when all rules are violated, then the validation should fail

@valentinabojan valentinabojan changed the title fix(guardrails): update validation result messages for backwards compatibility with low coded agents UI fix: fail guardrail validation only when all rules are violated Jan 20, 2026
@valentinabojan valentinabojan force-pushed the guardrails_validation_messages branch from 2542fe5 to cc9197f Compare January 20, 2026 14:25
@valentinabojan valentinabojan force-pushed the guardrails_validation_messages branch 2 times, most recently from d4ef5b6 to ef04db0 Compare January 20, 2026 14:28
@valentinabojan valentinabojan force-pushed the guardrails_validation_messages branch from ef04db0 to 711efc0 Compare January 20, 2026 15:56
@valentinabojan valentinabojan merged commit a040663 into main Jan 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants