
Generate a Pre-Run Privacy Coverage Report Without Leaking Raw PII
Source:R/pii.R
pii_privacy_report.RdScans a character vector, data frame text column, or pseudonymized result and returns aggregate PII detection counts and document coverage rates by entity type. Raw input text and matched sensitive values are strictly excluded from the returned object.
Usage
pii_privacy_report(x, config = pii_config(), text_col = NULL)Arguments
- x
A character vector, a data frame (requiring
text_col), or anairgap_pseudonymizedobject.- config
An
pii_config()configuration object.- text_col
Character scalar column name when
xis a data frame.
Value
An S3 object of class "airgap_privacy_report" containing only
aggregate counts (n_documents, n_documents_with_pii,
pct_documents_with_pii, total_entities, by_entity, config_digest,
generated_at).
Examples
notes <- c("Contact Dr. Alice Smith at alice@hospital.org.", "No identifiers here.")
pii_privacy_report(notes)
#> <airgap_privacy_report> (aggregate counts only; zero raw PII)
#> Documents scanned: 2
#> Documents with PII: 1 (50%)
#> Total detections: 2
#> By entity type:
#> - email: 1 (1 docs, 50%)
#> - person_name: 1 (1 docs, 50%)