Evaluators
Evaluators are self-contained logic modules that analyze specific aspects of AI interactions.
Each Evaluator answers a targeted analytical question (e.g., "Does this contain toxic language?", "Is this a prompt injection attempt?") using designated Analytic Engines. Evaluators are independent and reusable across different Laws, providing consistent analysis and detection capabilities.
Every Evaluator consists of:
- Configuration parameters that define execution settings
- Logic that processes input data
- Evaluation Finding that contains the analysis results
Core Concepts
How Evaluators Work
Evaluators analyze Exchanges - which can include Events, Transactions, or Sessions - to generate Evaluation Findings. These Findings are then used by Law Conditions to assess compliance with Laws. A single Law may use multiple Evaluators to make comprehensive decisions about policy compliance.
Key Benefits
- Reusability: Each Evaluator can be used across multiple Laws
- Consistency: Standardized analysis across your AI governance framework
- Flexibility: Configure thresholds and parameters to match your requirements
- Auditability: Clear documentation of detection logic and decision criteria
Analytic Engines
Evaluators use different types of Analytic Engines depending on their specific requirements. Each engine type offers distinct advantages for different use cases:
Search-based Evaluators
- Description: Fast pattern matching using carefully curated search terms and expressions
- Best For: Rapid detection of known patterns and simple text analysis
- Key Features:
- Lowest latency
- Highly predictable results
- Easy to audit and maintain
- Example Use Cases: Basic prompt injection detection, code pattern identification
Semantic-based Evaluators
- Description: Vector-based analysis comparing inputs against curated content collections
- Best For: Nuanced content analysis and classification
- Key Features:
- Robust to minor variations
- Context-aware analysis
- Training-free deployment
- Example Use Cases: Brand voice consistency, professional communication standards
Foundational Evaluators
- Description: Uses foundation models to perform complex analysis
- Best For: Complex assessment requiring reasoning
- Key Features:
- Sophisticated analysis capabilities
- Flexible evaluation criteria
- Natural language understanding
- Example Use Cases: High-risk scenario detection, business relevance analysis
Validation Evaluators
- Description: Internally hosted transformer models optimized for specific tasks
- Best For: High-accuracy classification of specific content types
- Key Features:
- High accuracy for targeted use cases
- Runs within your VPC
- Fast inference times
- Example Use Cases: Toxic content detection, advanced prompt injection analysis
Evaluator Comparison
| Category | Evaluator | Analytic Engine | Latency | Resource Usage | Best For |
|---|---|---|---|---|---|
| Security | PromptInjection-Search | Search | Very Low | Minimal | Quick first-pass injection detection |
| PromptInjection-Validation | Validation | Low | Low | High-accuracy injection analysis | |
| SqlInjection-Search | Search | Very Low | Minimal | SQL injection pattern detection | |
| FilePathDetection-Search | Search | Very Low | Minimal | File path identification and categorization | |
| Content Safety | ToxicLanguage-Validation | Validation | Low | Low | Multi-category toxicity detection |
| ToxicLanguage-Foundational | Foundational | Medium | Medium | Harmful content detection | |
| Privacy | PiiDetection-Ensemble | Ensemble | Low | Medium | Comprehensive PII detection |
| Code Detection | CodeDetection-Search | Search | Very Low | Minimal | Basic code pattern detection |
| CodeDetection-Semantic | Semantic | Medium | Medium | Nuanced code analysis | |
| JsonDetection-Search | Search | Very Low | Minimal | JSON structure detection | |
| Content Detection | WebsiteDetection-Search | Search | Very Low | Minimal | Website URL identification |
Getting Started
To begin using Evaluators:
- Review the comparison table above to identify Evaluators matching your needs
- Read the detailed documentation for your chosen Evaluators
- Configure the Evaluators according to your requirements
- Incorporate the Evaluators into your Laws using the ThirdLaw DSL
- Test and adjust thresholds as needed
For best practices in getting setup, see our Getting Started Guide.
Next Steps
- Learn about Creating Laws
- Understand Compliance Frameworks