kuroi.core.rules¶
rules ¶
Rule sets: declarative detector definitions, partly regex, partly LLM.
Category
dataclass
¶
A single detector definition within a rule set.
detection selects between regex matching (with pattern) and LLM
delegation (pattern unused). confidence is the level every Finding
emitted by this category will carry.
RuleSet
dataclass
¶
A named bundle of detector categories loaded from a rule pack YAML.
load_rule_set ¶
Load a built-in rule set by name. pii aliases to pii-en.
llm_categories ¶
Subset of categories the LLM is responsible for.
apply_regex_rules ¶
Apply every regex category in rs against the word-indexed pages.
A regex match that spans multiple words emits one Finding spanning the matched word range. Matches that span 0 words (e.g. a regex matching only inside a single word substring) collapse to that word's index.