Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security bug in example for "protectai/llm-guard/blob/main/examples/openai_api.py" #184

Open
jdwhitaker opened this issue Sep 3, 2024 · 1 comment

Comments

@jdwhitaker
Copy link

Describe the bug

Line 27 of protectai/llm-guard/blob/main/examples/openai_api.py says 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.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/protectai/llm-guard/blob/main/examples/openai_api.py line 27

Expected behavior
It should fail if any of the values is false.

@asofter
Copy link
Collaborator

asofter commented Sep 7, 2024

Hey @jdwhitaker , thanks for submitting this bug report. I will fix it. Indeed, there is an issue

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

No branches or pull requests

2 participants