fix(classifiers): PII NER allowlist for false positives and metal feature documentation#2541
Merged
fix(classifiers): PII NER allowlist for false positives and metal feature documentation#2541
Conversation
…r macOS Add configurable pii_ner_allowlist to ClassifiersConfig that prevents tokens matching an allowlist entry (case-insensitive) from being redacted by the piiranha NER model. Suppresses common false positives such as "Zeph" being misclassified as [PII:CITY] by piiranha-v1. Default allowlist entries: ["Zeph", "Rust", "OpenAI", "Ollama", "Claude"]. Configurable via [classifiers] pii_ner_allowlist in config.toml. Set to [] to disable the allowlist entirely. Also document that on macOS Apple Silicon, --features full,metal is required for piiranha NER GPU acceleration. Without metal, the 1.1 GB model times out after 30s on CPU and falls back to regex-only detection. Closes #2537, closes #2538
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pii_ner_allowlisttoClassifiersConfigto suppress piiranha NER false positives (e.g. "Zeph" →[PII:CITY])--features full,metalfor piiranha GPU accelerationChanges
crates/zeph-config/src/classifiers.rs—pii_ner_allowlist: Vec<String>field with default entries["Zeph", "Rust", "OpenAI", "Ollama", "Claude"]; configurable, empty-able; 6 new testscrates/zeph-sanitizer/src/lib.rs— allowlist field onContentSanitizer,with_pii_ner_allowlist()builder, case-insensitive exact-match filtering indetect_pii(); 6 new unit tests covering all edge casescrates/zeph-core/src/agent/builder.rs—with_pii_ner_allowlist()onAgentBuildersrc/agent_setup.rs— wires allowlist from config into agent setup pipelineTest plan
cargo nextest run -p zeph-config --features classifiers --lib— 182 passedcargo nextest run -p zeph-sanitizer --features classifiers --lib— 217 passed (6 new)cargo clippy --workspace --features full -- -D warnings— cleancargo +nightly fmt --check— cleanCloses #2537
Closes #2538