Skip to main content
While the DefaultRiskScorer handles most use cases, Attesta provides three additional scorer types that let you combine, override, or compose scoring strategies. All scorers implement the same RiskScorer protocol and can be used interchangeably.

Scorer Types at a Glance


CompositeRiskScorer

The CompositeRiskScorer 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 FixedRiskScorer to 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

The MaxRiskScorer 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
MaxRiskScorer is deliberately conservative. If you combine it with a scorer that returns high values for common operations, you may cause excessive approval friction. Monitor your approval rates after deployment.

FixedRiskScorer

The FixedRiskScorer always returns the same pre-configured score, regardless of the action context. While simple, it has several practical applications.

When to Use FixedRiskScorer

During incident response, you can swap to FixedRiskScorer(0.85) to force multi-party approval on all agent actions while you investigate. Return to the default scorer once the incident is resolved.

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