Guards Reference
QWED Open Responses provides 6 verification guards.SchemaGuard
Validates AI outputs against JSON Schema.Options
| Option | Type | Default | Description |
|---|---|---|---|
schema | dict | required | JSON Schema |
strict | bool | True | Fail on any error |
ToolGuard
Blocks dangerous tool calls and patterns.Default Blocked Tools
execute_shell,bash,cmddelete_file,remove_filesend_email,transfer_money
Default Dangerous Patterns
DROP TABLE,DELETE FROMrm -rf,rmdir /seval(,exec(,__import__
MathGuard
Verifies mathematical calculations.What It Checks
- Totals:
total = subtotal + tax + shipping - Percentages:
tax_amount = subtotal * tax_rate - Inline calculations:
"5 + 3 = 8"
StateGuard
Validates state machine transitions.ArgumentGuard
Validates tool call arguments.Supported Types
| Type | Validation |
|---|---|
string | Is string |
number | Is number, min/max |
integer | Is integer |
boolean | Is boolean |
email | Email format |
url | URL format |
uuid | UUID format |
enum | In allowed values |
pattern | Regex match |
SafetyGuard
Comprehensive safety checks.Detections
| Type | Examples |
|---|---|
| PII | Emails, phones, SSN, credit cards |
| Injection | ”ignore previous”, “you are now” |
| Harmful | API keys, passwords, private keys |
| Budget | Cost/token limits exceeded |