Policy JSON
{
"guard": {
"pii_detection": {
"enabled": true,
"action": "REDACT",
"patterns": ["EMAIL", "PHONE", "SSN", "CREDIT_CARD", "ADDRESS", "NAME"],
"redact_in_logs": true
},
"prompt_injection": {
"enabled": true,
"sensitivity": "high",
"action": "DENY",
"log_attempts": true
},
"content_moderation": {
"enabled": true,
"threshold": 0.7,
"categories": ["hate", "violence", "sexual", "self_harm"],
"action": "DENY"
}
},
"secrets": {
"enabled": true,
"confidence_threshold": 0.8,
"categories": ["api_keys", "tokens", "passwords", "cloud_secrets"],
"actions": {
"critical": "DENY",
"high": "DENY",
"medium": "REDACT"
}
},
"memory": {
"classification": "internal",
"enforce_read_governance": true,
"scopes": {
"global": { "classification_required": "public" },
"shared": { "classification_required": "internal" },
"user": { "classification_required": "internal" },
"session": { "classification_required": "internal" }
},
"deny_secrets_in_memory": true,
"deny_pii_in_memory": false
},
"registry": {
"models": ["gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet"],
"strict": true,
"tools": ["vector_search", "document_retrieve", "web_search"],
"deny_unlisted": true
},
"cost": {
"budget": {
"daily": 30.00,
"action_on_exceed": "DENY",
"alert_threshold": 0.8
},
"per_request_limit": 1.00,
"action_on_exceed": "DENY",
"estimate_before_execution": true
},
"reliability": {
"circuit_breaker": {
"failure_threshold": 5,
"reset_timeout_ms": 30000,
"half_open_max_attempts": 1
},
"retry": {
"max_retries": 3,
"backoff": "exponential",
"max_backoff_ms": 5000,
"action_on_exhausted": "DENY"
},
"fallback_chain": ["gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet"],
"action_on_chain_exhausted": "DENY"
},
"audit": {
"enabled": true,
"log_decisions": true,
"log_evidence": true,
"redact_pii": true,
"retention_days": 90
}
}
policy = {
"guard": {
"pii_detection": {
"enabled": True,
"action": "REDACT",
"patterns": ["EMAIL", "PHONE", "SSN", "CREDIT_CARD", "ADDRESS", "NAME"],
"redact_in_logs": True,
},
"prompt_injection": {
"enabled": True,
"sensitivity": "high",
"action": "DENY",
"log_attempts": True,
},
"content_moderation": {
"enabled": True,
"threshold": 0.7,
"categories": ["hate", "violence", "sexual", "self_harm"],
"action": "DENY",
},
},
"secrets": {
"enabled": True,
"confidence_threshold": 0.8,
"categories": ["api_keys", "tokens", "passwords", "cloud_secrets"],
"actions": {"critical": "DENY", "high": "DENY", "medium": "REDACT"},
},
"memory": {
"classification": "internal",
"enforce_read_governance": True,
"scopes": {
"global": {"classification_required": "public"},
"shared": {"classification_required": "internal"},
"user": {"classification_required": "internal"},
"session": {"classification_required": "internal"},
},
"deny_secrets_in_memory": True,
"deny_pii_in_memory": False,
},
"registry": {
"models": ["gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet"],
"strict": True,
"tools": ["vector_search", "document_retrieve", "web_search"],
"deny_unlisted": True,
},
"cost": {
"budget": {"daily": 30.00, "action_on_exceed": "DENY", "alert_threshold": 0.8},
"per_request_limit": 1.00,
"action_on_exceed": "DENY",
"estimate_before_execution": True,
},
"reliability": {
"circuit_breaker": {
"failure_threshold": 5,
"reset_timeout_ms": 30000,
"half_open_max_attempts": 1,
},
"retry": {
"max_retries": 3,
"backoff": "exponential",
"max_backoff_ms": 5000,
"action_on_exhausted": "DENY",
},
"fallback_chain": ["gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet"],
"action_on_chain_exhausted": "DENY",
},
"audit": {
"enabled": True,
"log_decisions": True,
"log_evidence": True,
"redact_pii": True,
"retention_days": 90,
},
}
What’s Included
| Dimension | Configuration | Why |
|---|---|---|
| Security | PII redaction + injection defense + content moderation | Retrieved documents may contain PII; injections can hide in document content |
| Secrets | Full secret scanning | Documents and code snippets in the knowledge base may contain credentials |
| Memory | Internal classification + secret denial | Document embeddings need classification; secrets must not enter vector stores |
| Registry | Capable models + retrieval tools | RAG needs good models for synthesis; tools limited to search/retrieval |
| Cost | 30/day+1/request | RAG queries can be token-heavy due to retrieved context |
| Reliability | Circuit breaker + retry + fallback | Ensure availability for document-backed queries |
Install
# Install the RAG application starter
tealtiger policy install --starter rag-application
# Or copy the JSON above into your tealtiger.config.json
Customize
| Setting | Default | Adjust For |
|---|---|---|
memory.deny_pii_in_memory | false | Set to true if your documents should not contain PII |
registry.tools | 3 retrieval tools | Add tools for your specific retrieval pipeline |
cost.per_request_limit | 1.00 | Raise if your documents are large (many retrieved chunks) |
guard.pii_detection.patterns | 6 patterns | Add domain-specific PII patterns |
RAG applications are particularly vulnerable to indirect prompt injection — malicious instructions embedded in retrieved documents. Keep
prompt_injection.sensitivity at high for RAG use cases.Related
- Prompt Injection — Strict — Critical for RAG applications
- Classification — Internal — Standalone memory classification
- Content Moderation — Standard — Output safety
- TealMemory Documentation — Full API reference

