Open jdwhitaker opened 2 weeks ago
Describe the bug
Line 27 of protectai/llm-guard/blob/main/examples/openai_api.py says if any(results_valid.values()) is False:
protectai/llm-guard/blob/main/examples/openai_api.py
if any(results_valid.values()) is False:
any(results_valid.values()) evaluates to True if any of the values are True. So this security check will pass if any of the values is true.
any(results_valid.values())
To Reproduce Steps to reproduce the behavior:
Expected behavior It should fail if any of the values is false.
Hey @jdwhitaker , thanks for submitting this bug report. I will fix it. Indeed, there is an issue
Describe the bug
Line 27 of
protectai/llm-guard/blob/main/examples/openai_api.py
saysif any(results_valid.values()) is False:
any(results_valid.values())
evaluates to True if any of the values are True. So this security check will pass if any of the values is true.To Reproduce Steps to reproduce the behavior:
Expected behavior It should fail if any of the values is false.