Overview
Every violation receives a confidence score (0–1) that combines multiple factors:- Rule Quality: Structural quality of the rule (threshold defined, conditions present)
- Signal Specificity: Bonus for compound AND conditions
- Statistical Anomaly: How unusual the value is vs. dataset distribution
- Bayesian Precision: Historical accuracy from user reviews
- Criticality Weight: CRITICAL severity gets a boost
Confidence Formula
Component Breakdown
1. Rule Quality (Base Score)
The base score comes from the rule quality validator:- ✅ Has a threshold defined
- ✅ Has conditions defined
- ✅ Has a policy excerpt
- ✅ Has a description
2. Signal Specificity Boost
Rules with multipleAND conditions get a bonus:
+0.15 to its score.
Signal Specificity Framework
Yggdrasil enforces a minimum specificity threshold of 2.0 for PDF-extracted rules. This prevents single-threshold rules from firing:3. Statistical Anomaly Detection
If dataset metadata is available, the engine compares the violation amount to the dataset mean:- Dataset mean: $1,000
- Violation amount: $15,000
- Ratio: 15x → +0.2 boost (extreme outlier)
4. Bayesian Historical Precision
The most important component: learning from user feedback.Formula Breakdown
Precision formula:(1 + TP) / (2 + TP + FP)
- TP: True positives (user approved)
- FP: False positives (user dismissed)
- Priors:
+1to numerator,+2to denominator (Bayesian smoothing)
History Weight
- 0 reviews: History weight = 0% (use rule quality only)
- 10 reviews: History weight = 50%
- 20+ reviews: History weight = 70% (cap)
Example: Rule Improvement
Initial state (0 reviews):5. Criticality Weight
CRITICAL severity rules get a final boost:Score Clamping
[0, 1] range.
Ranking Violations
After scoring, violations are sorted by confidence:Example Score Calculation
Rule: CTR Structuring Pattern- Rule quality: 0.80 (well-formed)
- AND conditions: 3 → +0.15
- Anomaly detection: 12x mean → +0.2
- Bayesian precision: 15 TP, 3 FP → 0.84, weight 70%
- Criticality: CRITICAL → +0.1
Confidence Tiers
| Range | Interpretation |
|---|---|
| 0.80–1.0 | High confidence — Very likely true positive |
| 0.60–0.79 | Medium confidence — Needs review |
| 0.40–0.59 | Low confidence — Likely needs tuning |
| 0.00–0.39 | Very low — Rule may be too noisy |
Impact on Compliance Score
Confidence scores do not affect the compliance score calculation. The compliance score is based on:- CRITICAL: 1.0
- HIGH: 0.75
- MEDIUM: 0.5
Why This Matters
For New Rules
- Start with reasonable confidence based on rule quality
- No “cold start” problem — rules fire immediately
For Established Rules
- Learn from user feedback
- Downweight noisy rules automatically
- Upweight accurate rules automatically
For Compliance Teams
- Focus on high-confidence violations first
- Trust the system more over time
- Reduce false positive fatigue
Next Steps
Bayesian Feedback
Learn how user reviews improve rules
Explainability
Understand violation explanations