Policy Template Guide
The TealTiger Playground ships with 15 enterprise-ready policy templates organized into six categories. Each template is fully customizable — adjust parameters, preview the generated code, and save to your workspace.Quick Start
- Open the Template Library from the sidebar
- Pick a template by category or search by name
- Click the template card to open the Template Customizer
- Adjust parameters using the form inputs
- Preview the generated code
- Click “Save to Workspace” to create a policy from the template
Template Categories
| Category | Count | Purpose |
|---|---|---|
| Security | 4 | Protect against attacks and data leaks |
| Cost Control | 3 | Manage budgets, rates, and token usage |
| Reliability | 3 | Handle failures, retries, and fallbacks |
| Compliance | 2 | Audit logging and data residency |
| Routing | 1 | Multi-provider request routing |
| Performance | 2 | Caching and load balancing |
Security Templates
1. PII Detection and Redaction
Detects PII in requests and responses, then blocks, redacts, or monitors.| Parameter | Default | Description |
|---|---|---|
action | REDACT | DENY, REDACT, or MONITOR |
piiTypes | all 5 types | email, phone, SSN, credit card, address |
redactionChar | * | Character used for redaction |
2. Content Moderation
Filters harmful content using toxicity scoring. Categories: hate speech, violence, sexual content, self-harm, harassment.| Parameter | Default | Description |
|---|---|---|
categories | 4 categories | Content categories to filter |
toxicityThreshold | 0.7 | Score threshold (0–1) |
action | DENY | DENY, MONITOR, or SANITIZE |
3. Prompt Injection Detection
Detects jailbreaks, role-playing exploits, instruction overrides, delimiter attacks, and encoding attacks.| Parameter | Default | Description |
|---|---|---|
sensitivity | medium | low, medium, or high |
blockJailbreaks | true | Block jailbreak attempts |
blockRolePlay | true | Block role-playing exploits |
4. RBAC Enforcement
Restricts AI model and feature access based on user roles with permission inheritance.| Parameter | Default | Description |
|---|---|---|
roleHierarchy | admin → editor → viewer | Role inheritance tree |
modelPermissions | per-role model lists | Models allowed per role |
strictMode | true | Deny unknown roles |
Cost Control Templates
5. Budget Enforcement
Per-request, daily, and monthly budget limits.| Parameter | Default | Range |
|---|---|---|
perRequestLimit | $0.10 | 100 |
dailyBudget | $10.00 | 10,000 |
monthlyBudget | $100.00 | 100,000 |
6. Rate Limiting
Sliding window rate limiting per user or API key.| Parameter | Default | Range |
|---|---|---|
requestsPerMinute | 10 | 1–1,000 |
requestsPerHour | 100 | 1–10,000 |
burstAllowance | 5 | 0–100 |
7. Token Optimization
Caps input/output tokens with optional prompt compression.| Parameter | Default | Range |
|---|---|---|
maxInputTokens | 2,000 | 100–100,000 |
maxOutputTokens | 1,000 | 50–100,000 |
compressionEnabled | true | — |
Reliability Templates
8. Circuit Breaker
Prevents cascading failures. States: CLOSED → OPEN → HALF_OPEN → CLOSED.| Parameter | Default | Description |
|---|---|---|
failureThreshold | 5 | Failures before opening |
timeout | 60,000ms | Time before half-open test |
halfOpenRequests | 3 | Test requests in half-open |
9. Retry Strategy
Exponential backoff with jitter for transient failures.| Parameter | Default | Description |
|---|---|---|
maxRetries | 3 | Maximum retry attempts |
initialDelay | 1,000ms | First retry delay |
maxDelay | 30,000ms | Maximum delay cap |
10. Model Fallback
Automatically switches to alternative models on failure.| Parameter | Default | Description |
|---|---|---|
fallbackChain | GPT-4 → GPT-3.5 → Claude | Ordered model list |
maxRetries | 3 | Retries per model |
fallbackOnRateLimit | true | Fallback on rate limits |
Compliance Templates
11. Audit Logging
Tamper-proof audit logs with PII redaction. Log levels: minimal, standard, detailed.12. Data Residency
Geographic restrictions on data processing. Supports 10 regions.Routing & Performance Templates
13. Multi-Provider Routing
Routes across providers using cost-optimized, latency-optimized, round-robin, or weighted strategies.14. Semantic Cache
Caches responses for semantically similar queries. Configurable similarity threshold and TTL.15. Load Balancing
Distributes requests using round-robin, least-connections, weighted, or random algorithms.Combining Templates
| Combination | Templates | Purpose |
|---|---|---|
| Security stack | PII + Content Moderation + Prompt Injection | Full input/output protection |
| Cost management | Budget + Rate Limiting + Token Optimization | Layered cost control |
| High availability | Circuit Breaker + Retry + Model Fallback | Resilient AI pipeline |
| Compliance bundle | Audit Logging + Data Residency + RBAC | Regulatory compliance |
| Performance | Semantic Cache + Load Balancing + Multi-Provider | Optimized throughput |

