In addition to the guard itself, you can also use the blockRequest flag to block requests when a guard is active and give a custom message to return instead.
Copy
guards=[MicrosoftPresidioConfig( guardName="MICROSOFT_PRESIDIO_GUARD", guardType="preQuery", entitiesToCheck=["EMAIL_ADDRESS"], blockRequest=True, # Pass this to block the request blockRequestMessage="You are not allowed to ask about this email address" # Pass this to give a custom message)]
Utilize Meta’s prompt guard to protect against jailbreaks and injection attacks. See the model card here for more information.Note: We recommend starting with only jailbreak with a value of 0.999 unless you know what you are doing
Copy
guards=[LLamaPromptGuardConfig( guardName="LLamaPromptGuard", jailbreakThreshold=0.9999, guardType="preQuery", # You'll likely only want to guard the input here)]
Utilize Microsoft’s Presidio Guard to protect against PII. See the model card here for more information.
Copy
guards=[MicrosoftPresidioConfig( guardName="MICROSOFT_PRESIDIO_GUARD", guardType="preQuery", entitiesToCheck=["EMAIL_ADDRESS"], # See the model card for the full list of entities to check)]