Skip to main content
Attesta defines three core enumerations that appear throughout the API: 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
And as values for the risk= parameter on the @gate decorator:
Python
CRITICAL-level actions are never downgraded by the trust engine, regardless of how much trust an agent has accumulated. This is an intentional safety invariant — CRITICAL actions always require full multi-party verification.

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, the multi_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.
Downgrading CRITICAL actions to a simpler challenge type (e.g., confirm) via a custom challenge map is technically possible but strongly discouraged. CRITICAL actions represent the highest-risk operations and should always require multi-party verification in production environments.

String Conversion

All enums use lowercase string values. You can construct enum members from strings:
Python