Skip to contents

Detect and scan

Find PII in text and in the columns of tables.

credgate credgate-package
credgate: Detect Indian Personal Data Before It Reaches Language Models
detect_pii()
Detect PII in text
scan_pii()
Scan the columns of a data frame for PII
preview()
Preview what would be redacted
cg_detectors()
List registered detectors
new_detector()
Define a PII detector
register_detector()
Register a detector
bounded()
Wrap a pattern so it only matches whole tokens
cg_normalise()
Normalise text for PII detection

Redact and tokenise

Replace identifiers before text leaves the machine, and restore them afterwards.

redact()
Redact PII from text
tokenise()
Replace identifiers with tokens that can be restored
restore()
Put the values behind tokens back into text
cg_vault()
Create a token vault
vault_merge()
Combine keyed vaults
vault_save() vault_open()
Save a vault to an encrypted file, and open it again
cg_new_token_key() cg_key_fingerprint()
Token keys for keyed tokens

Discovery and inventory

Record where PII is, across tables, Spark and BigQuery.

pii_inventory()
Record where PII is, for an inventory
write_inventory() read_inventory()
Write and read inventory files
inventory_database()
Record where PII is in every table of a database
bq_scan_pii() bq_pii_inventory() bq_inventory_dataset()
Scan and inventory BigQuery tables

Large data

redact_parquet()
Redact a Parquet file, batch by batch
redact_query()
Redact the result of a database query into a table

Policies and audit log

cg_policy()
Load a policy
policy_decide() policy_apply()
Decide and apply a policy to a request
cg_audit_log() audit_record() audit_verify() audit_read()
Audit log of policy decisions

Evaluation and test data

cg_evaluate()
Evaluate detection against labelled text
cg_read_corpus()
Read labelled documents from a JSON Lines file
synth_indian_pii()
Generate synthetic Indian identifiers

Checksums and the shared spec

verhoeff_valid() verhoeff_check_digit()
Verhoeff checksum (used by Aadhaar and Aadhaar Virtual ID)
luhn_valid()
Luhn checksum (payment cards)
gstin_valid() gstin_check_char()
GSTIN checksum
cg_spec_path()
Path to the detection spec shipped with the package