Skip to main content
The risk section of attesta.yaml lets you override the calculated risk level for specific actions and amplify scores based on pattern matching. These settings layer on top of the DefaultRiskScorer and any active domain profiles.

Configuration

attesta.yaml

Risk Overrides

Overrides force a specific action to a fixed risk level, bypassing the scorer entirely. The key is the function name and the value is one of: low, medium, high, or critical.
Overrides take absolute precedence over the risk scorer. If a function matches an override, the scorer is still invoked (for audit purposes) but its output is replaced by the override level.

When to Use Overrides

Overrides are best for actions where you know the risk level with certainty:

Programmatic Overrides

You can also set overrides via the Policy dataclass:

Risk Amplifiers

Amplifiers apply a regex pattern to the action name. When the pattern matches, the risk score is boosted by the specified amount (additive). Multiple amplifiers can stack.

How Amplifiers Work

  1. The DefaultRiskScorer produces a base score (e.g., 0.45)
  2. Each amplifier whose pattern matches the function name adds its boost
  3. The final score is clamped to [0.0, 1.0]
Example: A function named delete_production_data with a base score of 0.45: The base score of 0.45 (MEDIUM) is amplified to 0.95 (CRITICAL).
Amplifiers are additive and can stack. A function matching 3 amplifiers with boost: 0.2 each gets a total boost of 0.6. Design your patterns and boost values carefully to avoid unintentionally pushing all actions to CRITICAL.

Pattern Syntax

Amplifier patterns use Python’s re module (or JavaScript’s RegExp in the TypeScript SDK). The pattern is matched against the full function name.
Amplifiers are especially useful when you want to increase risk for a class of actions rather than listing individual overrides. Use overrides for specific known functions; use amplifiers for broad patterns.

Combining Overrides and Amplifiers

Overrides and amplifiers serve different purposes and can be used together:
In this configuration, deploy_production is always CRITICAL (override wins). But restart_production_service — which has no override — gets its score boosted by 0.3 from the amplifier.

Interaction with Domain Profiles

When a domain profile is active, domain-specific risk patterns are applied before the config-level amplifiers. The evaluation order is:
  1. DefaultRiskScorer produces a base score
  2. Domain profile risk patterns adjust the score
  3. Config-level amplifiers add their boosts
  4. Config-level overrides replace the final level (if matched)
  5. The score is clamped to [0.0, 1.0]

Next Steps

Risk Scoring

How the 5-factor DefaultRiskScorer works

Trust Section

Configure trust-based risk reduction