LLM Firewall
Create an LLM Firewall
Create the policy, validate its decisions and attach it to supported inference requests.
Create
In Firewall, select Create firewall. Under Basics set the name and slug; under Policy choose the evaluator and Monitor only; under Rules add and order the rules. Review the configuration and create the resource.
Validate and attach
Run representative prompts through evaluation, review false positives and then send the slug with the inference request.
After testing, edit the firewall and choose Block harmful input if the policy is ready to reject matching traffic. Use its slug in the supported inference request.
To test it in the platform, select the firewall, open Evaluate, enter an input and select Evaluate firewall. Review the decision, severity, reason and matched rules.
API example
Create a firewall in signal_only mode. First create the support-pii rule and replace moderation-model with a compatible evaluator endpoint. This request saves the firewall.
Set QDIV0_USER_API_KEY to a personal uk_ key. The default account is used; for another account you belong to, add its identifier in the X-Account-ID header.
1curl --fail-with-body \
2 --request POST \
3 "https://api.qdiv0.com/v1/firewalls" \
4 -H "Authorization: Bearer $QDIV0_USER_API_KEY" \
5 -H "Content-Type: application/json" \
6 --data '{"slug":"customer-input","name":"Customer input","mode":"signal_only","evaluator_serving_name":"moderation-model","rule_slugs":["support-pii"]}'