Rule Structure
Every rule has these core fields:Actions
Veto supports five action types:block
block
Deny execution immediately. Tool call fails with a Use for hard security boundaries (e.g., block production deployments, prevent rm -rf).
ToolCallDeniedError.require_approval
require_approval
Route to human approval queue. Execution pauses until approved/denied via callback URL.Configure approval webhook in See Approval Workflows for full guide.
veto.config.yaml:veto/veto.config.yaml
warn
warn
Log warning but allow execution. Useful for soft policy enforcement during testing.
log
log
Log decision only. No blocking, no warning. Ideal for audit trails and monitoring.
allow
allow
Explicitly permit. Useful for allowlists in combination with global block rules.
Tool Scoping
Rules apply to specific tools or all tools:Conditions (Deterministic Rules)
Conditions run locally with zero latency. No LLM call. Use dot notation for nested fields.Field Paths
All Operators
- Equality
- Strings
- Numeric
- Lists
- Time Windows
Condition Logic
AND logic (all conditions must match):Semantic Rules (LLM Validation)
For policies that can’t be expressed with static conditions, use semantic guidance:name and description to the LLM for semantic validation.
Hybrid Rules
Combine deterministic + semantic:- Deterministic conditions checked first (fast, local)
- If conditions match, rule triggers immediately
- If conditions don’t match, LLM evaluates semantic description
Best Practices
Deterministic First
Use static conditions whenever possible. Zero latency, no LLM cost.
Specific Tool Scoping
Narrow rule scope to relevant tools. Reduces false positives.
Explicit Severity
Tag rules with severity for dashboards and alerting.
Descriptive IDs
Use kebab-case IDs that describe intent.
Expression Syntax (Advanced)
Veto supports compiled policy expressions for complex logic:- Boolean operators:
and,or,not - Comparisons:
>,<,>=,<=,==,!= - String operators:
starts_with,ends_with,contains - Grouping:
(...)
field/operator/value when both are present.
Real-World Examples
Testing Rules
Before deploying, test rules withveto guard check:
Next Steps
Approval Workflows
Set up human-in-the-loop with approval callbacks
Audit Trail
Export decisions as JSON/CSV for compliance
Testing Policies
Write tests and validate rules before deployment
CI/CD Integration
Enforce policy coverage in your build pipeline

