Architecture
A domain profile is defined by theDomainProfile dataclass, which contains all the domain-specific configuration that layers on top of Attesta’s base scoring engine.
DomainProfile Structure
RiskPattern
Each risk pattern defines a regex that matches against a specific part of the action context:EscalationRule
Escalation rules define conditions that require additional approvers or notifications beyond the standard challenge:DomainChallengeTemplate
Challenge templates provide domain-specific questions for comprehension challenges:Domain Registry
TheDomainRegistry manages all registered domain profiles:
Merge Strategy
When merging multiple domains viaDomainRegistry.merge(), the strategy is conservative — it always picks the stricter option:
- Lists (risk_patterns, critical_actions, etc.): Union of all entries
- Dicts (sensitive_terms, min_review_overrides): Union with max value for conflicts
- Scalars (base_risk_floor, production_multiplier): Take the higher value
Registering Presets
You can register profiles as loadable presets for use inattesta.yaml:
Activation
Activate domain profiles viaattesta.yaml or programmatically:
Next Steps
Custom Domains
Build and deploy custom domain profiles
Custom Risk Scorer
Build risk scorers from scratch