RiskLevel enum. Each level determines the challenge type presented to the human operator.
Risk Level Thresholds
| Level | Score Range | Default Challenge | Color |
|---|---|---|---|
| LOW | 0.0 – 0.3 | Auto-approve | Green |
| MEDIUM | 0.3 – 0.6 | Confirm | Yellow |
| HIGH | 0.6 – 0.8 | Quiz | Orange |
| CRITICAL | 0.8 – 1.0 | Multi-party | Red |
Boundary values are inclusive on the lower bound. A score of exactly
0.3 is MEDIUM, a score of exactly 0.6 is HIGH, and a score of exactly 0.8 is CRITICAL.The RiskLevel Enum
from_score() Classification Logic
Visual Risk Bar
When using the TerminalRenderer, Attesta displays a colored risk bar in the terminal showing the score and level:Default Challenge Map
The default mapping from risk levels to challenges is:| Risk Level | Challenge | Reasoning |
|---|---|---|
| LOW | Auto-approve | Low-risk reads need no friction |
| MEDIUM | ConfirmChallenge | Simple Y/N confirmation with pause |
| HIGH | QuizChallenge | Forces operator to read and understand the action |
| CRITICAL | MultiPartyChallenge | Requires 2+ independent approvers |
Overriding the Challenge Map
Trust-Adjusted Risk
The Trust Engine can shift the effective risk level for agents with a proven track record. A trusted agent’s MEDIUM action might be treated as LOW, reducing friction. However, a critical safety invariant applies:Comparison Table
| Aspect | LOW | MEDIUM | HIGH | CRITICAL |
|---|---|---|---|---|
| Score range | 0.0–0.3 | 0.3–0.6 | 0.6–0.8 | 0.8–1.0 |
| Typical actions | Read, list, check | Create, update, set | Deploy, execute, run | Delete, drop, destroy |
| User friction | None | ~3 seconds | ~10 seconds | ~30+ seconds |
| Approvers needed | 0 | 1 | 1 | 2+ |
| Trust can downgrade | N/A | Yes | Yes | No |
| Audit logged | Yes | Yes | Yes | Yes |
Risk Scoring
How the 5-factor scorer produces a numeric score
Challenges
The challenge system and how levels map to challenges