Policies API
Policies allow you to control how Perf routes requests and handles content. Set model preferences, enforce cost limits, detect PII, and filter sensitive terms.Why Policies?
- Cost Control: Set budget limits and prefer cheaper models
- Compliance: Block specific providers or require certain models
- Security: Detect and redact PII from outputs
- Governance: Monitor and control content with term filtering
Policy Types
Policy Templates API
Get pre-built policy templates to quickly enable common configurations.List Templates
Get Template by Slug
Available Templates
Routing Templates
Content Templates (Pro+)
Routing Policy Options
Configure how Perf selects models:
Example - Google Only Policy:
Content Policy Options
Configure content filtering and PII detection:
Example - PII Protection Policy:
Supported PII Types
Violation Actions
Policy Blocked Response
When a request is blocked by ahard_block policy:
Managing Policies via Dashboard
Policies are configured per-project in the Perf Dashboard:- Navigate to Configure > Policies
- Click Create Policy or Apply Template
- Configure rules and violation actions
- Set priority (lower number = higher priority)
- Enable the policy
Plan Limits
Related
- Chat API - See policy evaluation in responses
- Schema Enforcement - Validate JSON output structure