RiskLevel for discrete risk classifications, Verdict for approval outcomes, and ChallengeType for verification challenge kinds.
RiskLevel
Discrete risk classification derived from a continuous 0-1 score.Import
Values
from_score() Classmethod
Maps a continuous risk score to a discrete level.Signature
Returns: The corresponding
RiskLevel.
Raises: ValueError if score is outside [0.0, 1.0].
Using in Configuration
Risk levels are used as keys in the challenge map configuration:attesta.yaml
risk= parameter on the @gate decorator:
Python
Verdict
The outcome of an Attesta review. Determines whether the protected function executes.Import
Values
Behavior in @gate
The@gate decorator maps verdicts to behavior:
Checking Verdicts
The
MODIFIED verdict is currently only produced by custom renderers that return it from render_approval(). The built-in renderers never produce MODIFIED — they return either APPROVED or DENIED.ChallengeType
The kind of verification challenge presented to the operator. Determines the level of cognitive engagement required before the action can proceed.Import
Values
Default Challenge Map
The built-in mapping from risk level to challenge type:Python
Custom Challenge Maps
You can override the default mapping per-gate or via configuration:Challenge Escalation in Multi-Party
For CRITICAL actions, themulti_party challenge type assigns different sub-challenges to each approver in descending order of rigor:
This ensures that at least one approver demonstrates deep comprehension of the action before it proceeds.
String Conversion
All enums use lowercase string values. You can construct enum members from strings:Python