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:| Use Case | Override | Rationale |
|---|---|---|
| Production deployments | critical | Always require full multi-party approval |
| Database migrations | high | Schema changes need comprehension quiz |
| Read-only health checks | low | No risk, auto-approve silently |
| Known safe utilities | low | Skip unnecessary friction |
| Compliance-mandated | critical | Regulatory requirement |
Programmatic Overrides
You can also set overrides via thePolicy 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
- The
DefaultRiskScorerproduces a base score (e.g.,0.45) - Each amplifier whose
patternmatches the function name adds itsboost - The final score is clamped to
[0.0, 1.0]
delete_production_data with a base score of 0.45:
| Amplifier | Pattern | Matches? | Boost |
|---|---|---|---|
| Production | .*production.* | Yes | +0.30 |
| Delete | .*delete.* | Yes | +0.20 |
| Final score | 0.95 |
0.45 (MEDIUM) is amplified to 0.95 (CRITICAL).
Pattern Syntax
Amplifier patterns use Python’sre module (or JavaScript’s RegExp in the TypeScript SDK). The pattern is matched against the full function name.
Combining Overrides and Amplifiers
Overrides and amplifiers serve different purposes and can be used together:| Feature | Overrides | Amplifiers |
|---|---|---|
| Granularity | Per function name (exact match) | Regex pattern (broad match) |
| Effect | Replaces scorer output entirely | Adds to scorer output |
| Stacking | Last match wins | All matches stack |
| Best for | Known critical/safe actions | Environmental risk factors |
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:DefaultRiskScorerproduces a base score- Domain profile risk patterns adjust the score
- Config-level amplifiers add their boosts
- Config-level overrides replace the final level (if matched)
- 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