Skip to main content
The policy section of attesta.yaml controls how Attesta responds to different risk levels. It defines the challenge type for each risk tier, minimum review durations, multi-party approval requirements, and what happens when things go wrong.

Default Challenge Mappings

When no policy is configured, Attesta uses these defaults: These mappings are configured via the challenge_map field on the Policy dataclass.

Configuration

attesta.yaml

Minimum Review Seconds

The minimum_review_seconds setting enforces a mandatory waiting period before an operator can approve an action. This is Attesta’s primary defense against rubber-stamping — approving actions without actually reading them.
The timer starts when the challenge is first presented. If the operator attempts to approve before the timer expires, the approval is rejected and they must wait.
Custom domain profiles can set even longer review times via the min_review_overrides field. For example, a compliance-focused profile might override CRITICAL to 60 seconds and HIGH to 20 seconds.

Programmatic Access

The Policy dataclass exposes minimum review times through the min_review_time() method:

Multi-Party Approval

The require_multi_party setting specifies how many independent approvers are needed for each risk level. Only risk levels listed in this mapping trigger multi-party review.
When multi-party approval is required, each approver completes a different sub-challenge in a rotating pattern: teach-back, then quiz, then confirm. This ensures that at least one approver demonstrates genuine comprehension.
The critical_always_verify flag on the Policy dataclass is hardcoded to True and cannot be disabled via configuration. CRITICAL actions always require full verification regardless of trust score. This is a safety invariant.

Fail Mode

The fail_mode setting controls what happens when a challenge times out or the system cannot reach a human operator.
The action is blocked with verdict TIMED_OUT. The gate decorator raises AttestaDenied. This is the safest option and the recommended setting for production.
Never deploy with fail_mode: allow in production. If a timeout or network issue prevents human review, the action will execute without any approval — this defeats the entire purpose of Attesta.

Timeout

The timeout_seconds setting defines the maximum time (in seconds) to wait for the operator to complete a challenge. After this duration, the fail_mode policy takes effect.
For long-running operations where operators may need extra time to investigate:

Policy Dataclass

The full Policy dataclass provides programmatic access to all policy settings and several convenience methods:

Method Reference

Example: Strict Production Policy

attesta.yaml
This policy enforces:
  • 15-second minimum review for HIGH-risk actions
  • 60-second minimum review for CRITICAL actions
  • 3 independent approvers for CRITICAL, 2 for HIGH
  • 10-minute timeout before actions are denied
  • All timeouts result in denial (never auto-allow)

Next Steps

Risk Section

Force risk levels and amplify scores with patterns

Challenges

Learn how each challenge type works