sil-cli 0.1.0

CLI for the Semantic Integrity Layer — scan input for Unicode spoofing, confusable attacks, and semantic drift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use sil_policy::rules::RiskInput;

pub fn build_risk_input(confusable_flags: &[String], semantic_score: f32) -> RiskInput {
    RiskInput {
        unicode_risk: if confusable_flags.is_empty() {
            0.1
        } else {
            0.8
        },
        confusable_risk: if confusable_flags.is_empty() {
            0.1
        } else {
            0.9
        },
        semantic_risk: 1.0 - semantic_score,
    }
}