How It Works
A domain profile layers on top of Attesta’s base 5-factor risk scorer to add industry-specific signals:- Risk Patterns — regex patterns that boost the risk score when matched against function names, arguments, or docstrings
- Sensitive Terms — individual words with associated risk weights
- Critical / Safe Actions — function name patterns that always score as CRITICAL or LOW
- Escalation Rules — conditions that trigger additional approvers or notifications
- Challenge Templates — domain-specific verification questions
- Risk Floor & Production Multiplier — minimum scores and environment amplification
DomainProfile Dataclass
Each profile is aDomainProfile dataclass:
| Field | Type | Description |
|---|---|---|
risk_patterns | list[RiskPattern] | Regex patterns with risk contributions |
sensitive_terms | dict[str, float] | Terms mapped to risk weights (0.0-1.0) |
critical_actions | list[str] | Action names that are always CRITICAL |
safe_actions | list[str] | Action names that are always LOW |
compliance_frameworks | list[str] | Applicable compliance standards |
escalation_rules | list[EscalationRule] | Conditions for extra approvers |
challenge_templates | list[DomainChallengeTemplate] | Custom challenge questions |
min_review_overrides | dict[str, float] | Per-risk-level review time overrides (seconds) |
base_risk_floor | float | Minimum risk score for all actions in this domain |
production_multiplier | float | Score multiplier when environment is production |
required_vocabulary | list[str] | Terms that must appear in teach-back explanations |
Creating a Domain Profile
Using Domain Profiles
DomainRegistry
TheDomainRegistry manages profile registration, retrieval, and merging:
Merge Behavior
When merging multiple profiles, the registry follows these rules:| Field | Merge Strategy |
|---|---|
risk_patterns | Union of all patterns |
sensitive_terms | Union; duplicate terms take the higher weight |
critical_actions | Union (deduplicated) |
safe_actions | Union (deduplicated) |
compliance_frameworks | Union (deduplicated) |
escalation_rules | Union of all rules |
base_risk_floor | Maximum across all profiles |
production_multiplier | Maximum across all profiles |
required_vocabulary | Union (deduplicated) |
Configuration via YAML
attesta.yaml
Domain names in
attesta.yaml must match presets registered via register_preset() before loading the config. See Custom Domains for setup instructions.Custom Domains
Build your own domain profile
Domain Overview
Architecture and merge strategy