LLM Firewall
Write firewall rules
Describe one policy decision clearly enough for the judge model to return a consistent result.
One decision per rule
Write short, binary instructions that name the category being evaluated. Avoid broad terms that different reviewers could interpret differently.
In Firewall Rules, select Create rule, complete the form and save it. You can then add it and set its position when creating or editing a firewall.
Test representative inputs
Include expected matches, safe near-misses and adversarial wording. Review the judge reason before moving from Monitor only to blocking.
API example
Create a reusable privacy rule. The request saves the rule; change the slug and prompt before using it.
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/firewall-rules" \
4 -H "Authorization: Bearer $QDIV0_USER_API_KEY" \
5 -H "Content-Type: application/json" \
6 --data '{"slug":"support-pii","name":"Support PII","description":"Detect personal data","prompt":"Detect personal data in the input.","category":"privacy","default_severity":"high"}'