Sensitive-data classification suggestions
bluep proposes labels for logical entities and attributes, and optionally physical tables and columns. It never accepts a suggestion without explicit reviewer choice.
Privacy and threat model
Metadata-only suggestions inspect names, types and descriptions without querying data. Optional sampling uses an installed local client and a bounded number of non-null values per column. Raw values never enter plans, model files, audit entries, logs or reports. Values are counted one row at a time and the buffer is cleared before the next row. Only aggregate counts survive. The SQLite command-line sampling backend is implemented; other database clients require further support.
Rule catalog and confidence
Recognized categories are email, phone, postal code, national identifier, payment card, date of birth, person name and address. The engine matches entire camel-case and separator-delimited words and bounded phrases, not arbitrary substrings. Name evidence contributes 70 points, compatible type 10, and a descriptive comment 65, capped at 100. The requested minimum confidence filters suggestions. Same-or-higher classifications and already recorded decisions are excluded.
Pattern checks use bounded lengths and a Luhn checksum for card numbers. Postal codes and national identifiers require explicit country CA, US or GB. Date-of-birth must be a plausible ISO date. Matching sample ratios of 80% (with at least five values) and 50% contribute 30 and 15 confidence points respectively. Sample evidence contains only counts.
CLI workflow
Preview metadata rules: bluep classify suggest <dir> --classification pii --level direct.
Write a canonical plan: bluep classify suggest <dir> --classification pii --level direct --plan /tmp/plan.json.
Record explicit choices: bluep classify apply <dir> --plan /tmp/plan.json --accept 'v1|attribute:customer.email|email|pii|direct' --reject 'v1|attribute:customer.phone_number|phone|pii|direct' --write.
Previewing apply without --write does not modify files. Suggestions exit 1 if changes are found and no plan was written; writing a plan exits 0. An accepted decision records both object classification and a stable decision record. A rejected decision records only the decision. Evidence versions are currently 1; previous decisions suppress repeated offers.
Live sampling is explicitly enabled: bluep classify suggest <dir> --classification pii --level direct --sample-values --target lite --database /path/to/file.sqlite --sample-limit 25 --json. Valid limits are 1..1000; sampling an unsupported dialect fails safely and never includes database bytes in error messages.
Persisted format
Persisted text contains a classification_decision "v1|attribute:customer.email|email|pii|direct" { ... } declaration with object selector, classification, level, status accepted|rejected and evidence_version 1. Decisions sort by id. Older models without decisions remain unchanged. JSON export and import preserve decisions, and merge treats them as keyed objects.
Reports, RPC and web
bluep report <dir> --template sensitive-data --format csv --var classification=pii --var level=direct exports Object, Kind, Classification, Level, Confidence and Evidence columns. The family also supports Markdown, HTML, text, XLSX and PDF.
JSON-RPC methods classification.suggest and classification.decide mirror the local engine. Browser Classify shows each suggestion and its sanitized evidence, with Accept, Reject and Skip controls. Preview is read-only; decision writes require an unchanged model fingerprint and Edit role in team mode, and audits contain decision ids and statuses rather than raw rows.
A reviewer can keep a suggestion unrecorded by choosing Skip; only explicit Accept and Reject choices are persisted. Repeating a recorded decision does not introduce a second record.
False positives and limitations
These rules are advisory. A name may imply sensitivity without containing sensitive data; a limited sample does not prove all rows fit a pattern; country formats cannot verify real identity. No automatic acceptance, data masking, external classifier, persistent row cache, remediation or telemetry is included.