RiskScorer protocol and can be used interchangeably.
Scorer Types at a Glance
CompositeRiskScorer
TheCompositeRiskScorer combines multiple scorers by computing a weighted average of their scores. Weights are normalized internally, so they do not need to sum to 1.0.
When to Use CompositeRiskScorer
- Domain blending — Combine a domain-specific scorer with the default scorer
- Risk floor — Add a
FixedRiskScorerto ensure no action scores below a certain threshold - Gradual migration — Transition from one scorer to another by adjusting weights over time
Weights are normalized internally. Passing weights of
(3, 1) is identical to passing (0.75, 0.25). Use whatever scale is most readable for your team.MaxRiskScorer
TheMaxRiskScorer runs multiple scorers and takes the maximum score across all of them. This is the most conservative strategy — if any scorer considers an action risky, the overall score reflects that.
When to Use MaxRiskScorer
- Defense in depth — Multiple independent scorers act as safety nets
- Compliance overlays — A compliance scorer can veto the default scorer’s low rating
- Red lines — Ensure certain patterns always trigger high-risk regardless of other factors
FixedRiskScorer
TheFixedRiskScorer always returns the same pre-configured score, regardless of the action context. While simple, it has several practical applications.
When to Use FixedRiskScorer
The RiskScorer Protocol
All scorers implement the same protocol, making it straightforward to build your own.Combining Strategies
You can nest scorers to build sophisticated policies:Risk Scoring
How DefaultRiskScorer’s 5 factors work
Custom Scorer Guide
Build your own scorer from scratch