pub trait SafetyNet: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn supported_locales(&self) -> &[LocaleTag];
fn check(
&self,
clean_text: &str,
context: SafetyNetContext<'_>,
) -> Result<Vec<LeakSuspect>, SafetyNetError>;
}Expand description
Observer-only post-clean check (Pass 3 in the detection pipeline).
Runs against already-tokenized output. May report suspected missed PII via
LeakReport but must not mutate the token manifest, the CleanDocument,
or the restore path. Safety nets are additive defense-in-depth, not a replacement
for Pass 1/2 detection.
Activate at runtime with Pipeline::with_safety_net (post-build) or
PipelineBuilder::register_safety_net (during build), or via the CLI
--safety-net=<name> flag.
If a safety net reports a suspected miss, the caller decides the response; the pipeline never silently re-cleans based on safety net output.
Required Methods§
Sourcefn supported_locales(&self) -> &[LocaleTag]
fn supported_locales(&self) -> &[LocaleTag]
Locale tags supported by this safety net. Empty means global.
Sourcefn check(
&self,
clean_text: &str,
context: SafetyNetContext<'_>,
) -> Result<Vec<LeakSuspect>, SafetyNetError>
fn check( &self, clean_text: &str, context: SafetyNetContext<'_>, ) -> Result<Vec<LeakSuspect>, SafetyNetError>
Checks clean text for possible PII that the manifest did not cover.