PromptGuard uses a composable preset system that combines use-case templates with strictness levels. This gives you fine-grained control over security policies while providing sensible defaults for common scenarios.
Composable Preset System
PromptGuard presets are composed of two parts:- Use Case Template - Defines patterns, domains, and toxicity settings for your specific use case
- Strictness Level - Controls detection thresholds (strict, moderate, permissive)
Use Case Templates
Default (Recommended)
Best for: General AI applications and most production use cases- Custom Patterns: None
- Allowed Domains: All
- Blocked Domains: None
- Toxicity Config: Disabled
- Use Cases: Most production applications, general business use
Support Bot
Best for: Customer support chatbots and help desk applications- Custom Patterns: Password/account queries, admin access attempts
- Allowed Domains: All
- Blocked Domains: Internal/admin systems
- Toxicity Config: Disabled
- Use Cases: Customer service, help desks, support systems
- Custom patterns for password/account queries
- Blocked domains for admin/internal access
- Optimized for customer interaction scenarios
Code Assistant
Best for: AI coding assistants and code generation tools- Custom Patterns: API keys, secrets, credentials
- Allowed Domains: GitHub, Stack Overflow, documentation sites
- Blocked Domains: None
- Toxicity Config: Disabled
- Use Cases: IDEs, code generation, development tools
- API key and secret detection patterns
- Allowed domains for GitHub, Stack Overflow, docs
- Optimized for code generation scenarios
RAG System
Best for: Retrieval-augmented generation with document knowledge- Custom Patterns: Confidential, proprietary, internal content
- Allowed Domains: All
- Blocked Domains: Internal/staging systems
- Toxicity Config: Disabled
- Use Cases: Knowledge bases, document Q&A, enterprise RAG
- Custom patterns for confidential/proprietary content
- Blocked domains for internal/staging systems
- Enhanced data leak prevention
Data Analysis
Best for: Data processing and analysis with sensitive information- Custom Patterns: SSN, DOB, sensitive data patterns
- Allowed Domains: All
- Blocked Domains: External/public domains
- Toxicity Config: Disabled
- Use Cases: Analytics, data pipelines, business intelligence
- Enhanced data protection patterns
- Blocked external/public domains
- Comprehensive exfiltration prevention
Creative Writing
Best for: Creative content generation and writing assistance- Custom Patterns: None
- Allowed Domains: All
- Blocked Domains: None
- Toxicity Config: Enabled with ML, threshold 0.8, categories (hate, sexual, violence)
- Use Cases: Content generation, writing tools, creative applications
- ML-based toxicity detection enabled
- Higher toxicity threshold (0.8) for creative content
- Category filtering (hate, sexual, violence)
- Optimized for content generation scenarios
Strictness Levels
Each use case template can be combined with one of three strictness levels:Strict
- PII Detection: Strict (detects all PII types)
- Injection Detection: Strict (lower ML threshold: 0.6)
- Exfiltration Detection: Strict (lower ML threshold: 0.7)
- Output Safety: Strict (lower toxicity threshold: 0.6)
- Best for: High-security applications, sensitive data handling
Moderate (Default)
- PII Detection: Moderate (detects common PII types)
- Injection Detection: Moderate (ML threshold: 0.8)
- Exfiltration Detection: Moderate (ML threshold: 0.8)
- Output Safety: Moderate (toxicity threshold: 0.7)
- Best for: Most production applications, balanced security
Permissive
- PII Detection: Permissive (only SSN/credit cards)
- Injection Detection: Permissive (higher ML threshold: 0.9)
- Exfiltration Detection: Permissive (higher ML threshold: 0.9)
- Output Safety: Permissive (higher toxicity threshold: 0.8)
- Best for: Low-risk applications, development/testing
Choosing the Right Preset
Decision Matrix
| Use Case | Recommended Use Case | Recommended Strictness | Alternative |
|---|---|---|---|
| General AI Application | Default | Moderate | - |
| Customer Support | Support Bot | Strict | Support Bot + Moderate |
| Code Generation | Code Assistant | Moderate | Code Assistant + Strict |
| Document Q&A | RAG System | Strict | RAG System + Moderate |
| Data Processing | Data Analysis | Strict | Data Analysis + Moderate |
| Content Creation | Creative Writing | Moderate | Creative Writing + Permissive |
Recommendation Flow
Configuring Presets
Via Dashboard
-
Access Project Settings
- Login to app.promptguard.co
- Navigate to Projects > [Your Project] > Overview
- Find the “Policy Preset” section
-
Choose Use Case and Strictness
- Select your Use Case from the first dropdown (e.g., “Support Bot”, “Code Assistant”)
- Select your Strictness Level from the second dropdown (Strict, Moderate, Permissive)
- The preset is automatically composed (e.g., “Support Bot / Strict”)
-
Test Configuration
- Make test requests to validate the preset
- Monitor security events in the dashboard
- Adjust with custom policies if needed
Via API
Developer API Endpoints: The preset management endpoints below are part of the Developer API and are included in the OpenAPI spec. They use API key authentication and are suitable for SDK usage.
Response Formats
List Use Cases Response (200 OK)Preset Format: Use
"use_case:strictness" format (e.g., "support_bot:strict") or just the use case name (defaults to moderate strictness).Preset Comparison
Use Case Templates Comparison
| Feature | Default | Support Bot | Code Assistant | RAG System | Data Analysis | Creative Writing |
|---|---|---|---|---|---|---|
| Custom Patterns | None | Password/Account | API Keys/Secrets | Confidential | SSN/DOB | None |
| Allowed Domains | All | All | GitHub, Stack Overflow, Docs | All | All | All |
| Blocked Domains | None | Internal/Admin | None | Internal/Staging | External/Public | None |
| ML Toxicity | Disabled | Disabled | Disabled | Disabled | Disabled | Enabled (0.8 threshold) |
Strictness Level Comparison
| Detection Type | Strict | Moderate | Permissive |
|---|---|---|---|
| PII Detection | All types | Common types | SSN/Credit cards only |
| Injection ML Threshold | 0.6 | 0.8 | 0.9 |
| Exfiltration ML Threshold | 0.7 | 0.8 | 0.9 |
| Toxicity Threshold | 0.6 | 0.7 | 0.8 |
Performance Impact
All presets have similar performance characteristics:| Metric | Impact |
|---|---|
| Latency | +30-50ms overhead |
| Throughput | Minimal impact |
| Resource Usage | Low to moderate |
Customizing Presets
Adding Custom Policies
You can enhance any preset with custom policies:- Navigate to Projects > [Your Project] > Policies
- Click “Create Policy”
- Define custom rules that complement your preset
- Custom policies apply in addition to preset rules
Preset + Custom Policies
Presets provide the foundation, and custom policies add specific rules:Monitoring Preset Performance
Key Metrics to Track
-
Security Events
- Track blocked requests by type
- Monitor threat patterns
- Validate detection accuracy
-
False Positive Rate
- Monitor legitimate requests being blocked
- Adjust with custom policies if needed
- Target: 1% for most presets
-
Performance Impact
- Measure latency overhead
- Track error rates
- Monitor user experience
Dashboard Views
Access preset-specific analytics:- Projects > [Your Project] > Analytics
- Filter by time range and security events
- Compare metrics across different configurations
- Export data for detailed analysis
Best Practices
Development Workflow
- Start with Default + Moderate: Begin with
default:moderatefor most applications - Choose Use-Case Template: If you have a specific use case, select the matching template
- Adjust Strictness: Start with
moderate, then adjust tostrictorpermissivebased on needs - Add Custom Policies: Enhance with custom rules for specific needs
- Monitor Continuously: Track performance and adjust as needed
Preset Transitions
When changing presets:- Test in Staging: Apply new preset to staging environment first
- Monitor Metrics: Check security events and false positives for 24-48 hours
- Gradual Rollout: Use feature flags for gradual production rollout if needed
- Monitor and Adjust: Watch for issues and fine-tune strictness level or add custom policies
Strictness Level Guidelines
- Start Moderate: Most applications work well with moderate strictness
- Go Strict If: Handling sensitive data, high-security requirements, compliance needs
- Go Permissive If: Low-risk scenarios, development/testing, high false positive rates
Troubleshooting
High False Positive Rate
High False Positive Rate
Solutions:
- Review security events to identify patterns
- Add custom whitelist policies for legitimate use cases
- Consider switching to a more permissive preset (if appropriate)
- Contact support for preset tuning assistance
Security Events Not Being Detected
Security Events Not Being Detected
Solutions:
- Verify you’re using appropriate preset for your security needs
- Check if custom policies are overriding preset behavior
- Test with known malicious prompts
- Ensure preset is correctly applied to your project
Need More Granular Control
Need More Granular Control
Solutions:
- Use custom policies to add specific rules
- Combine preset with custom policies for fine-tuned control
- Review preset details to understand what’s enabled
- Contact support for custom preset recommendations
Next Steps
Custom Rules
Create custom security rules beyond presets
Threat Detection
Configure advanced threat detection
Monitoring
Monitor security events and performance
API Reference
Complete API documentation for presets