Package: credgate 0.1.0.9000

Bharat Sikka

credgate: Detect Indian Personal Data Before It Reaches Language Models

Detects personal data in text before it is sent to a large language model, with Indian identifiers built in: Aadhaar (validated with the Verhoeff checksum), Aadhaar Virtual ID, PAN, GSTIN, voter ID, passport, driving licence, CKYC, ration card and job card numbers, UPI IDs, IFSC codes, bank account and payment card numbers with expiry dates and verification codes, mobile numbers and Ayushman Bharat (ABHA) health IDs, plus rule-based detection of names and addresses in Latin and Indic scripts. Candidates are validated with checksums, scored from surrounding context and matched through Indic digits and invisible characters. The rules come from a language-neutral specification shared with the 'Python' package of the same name.

Authors:Bharat Sikka [aut, cre, cph], Aishwarya Bais [aut, cph]

credgate_0.1.0.9000.tar.gz
credgate_0.1.0.9000.zip(r-4.7-any)credgate_0.1.0.9000.zip(r-4.6-any)credgate_0.1.0.9000.zip(r-4.5-any)
credgate_0.1.0.9000.tgz(r-4.6-any)credgate_0.1.0.9000.tgz(r-4.5-any)
credgate_0.1.0.9000.tar.gz(r-4.7-any)credgate_0.1.0.9000.tar.gz(r-4.6-any)
credgate_0.1.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
credgate/json (API)

# Install 'credgate' in R:
install.packages('credgate', repos = c('https://dwarpal.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/dwarpal/credgate/issues

Pkgdown/docs site:https://dwarpal.github.io

On CRAN:

Conda:

3.00 score 41 exports 5 dependencies

Last updated from:30f417bfdb. Checks:6 OK, 3 ERROR. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK224
source / vignettesOK222
linux-releaseOK269
macos-releaseOK316
macos-oldrelOK2055
windows-develERROR391
windows-releaseERROR315
windows-oldrelERROR382
wasm-releaseOK107

Exports:audit_readaudit_recordaudit_verifyboundedbq_inventory_datasetbq_pii_inventorybq_scan_piicg_audit_logcg_detectorscg_evaluatecg_key_fingerprintcg_new_token_keycg_normalisecg_policycg_read_corpuscg_spec_pathcg_vaultdetect_piigstin_check_chargstin_validluhn_validnew_detectorpii_inventorypolicy_applypolicy_decidepreviewread_inventoryredactredact_parquetredact_queryregister_detectorrestorescan_piisynth_indian_piitokenisevault_mergevault_openvault_saveverhoeff_check_digitverhoeff_validwrite_inventory

Dependencies:clijsonliterlangstringiyaml

Large data: Arrow, Parquet, DuckDB and databases
Which columns hold personal data? | Arrow and Parquet | DuckDB and other databases | Other databases | Sizes and speed

Last update: 2026-11-01
Started: 2026-11-01

Using credgate with local LLMs (Ollama, vLLM)
Why redact when the model is local? | 1. Preview, then redact | 2. Ollama | 3. vLLM (or any OpenAI-compatible server) | 4. Getting the real values back: tokenise and restore | 5. Data frames: find the PII, send only what is needed | 6. Measure it on your own data | Limits and what comes next

Last update: 2026-11-01
Started: 2026-10-31

Readme and manuals

Help Manual

Help pageTopics
Wrap a pattern so it only matches whole tokensbounded
Scan and inventory BigQuery tablesbq_inventory_dataset bq_pii_inventory bq_scan_pii
Audit log of policy decisionsaudit_read audit_record audit_verify cg_audit_log
List registered detectorscg_detectors
Evaluate detection against labelled textcg_evaluate
Token keys for keyed tokenscg_key_fingerprint cg_new_token_key
Normalise text for PII detectioncg_normalise
Load a policycg_policy
Read labelled documents from a JSON Lines filecg_read_corpus
Path to the detection spec shipped with the packagecg_spec_path
Create a token vaultcg_vault
Detect PII in textdetect_pii
GSTIN checksumgstin_check_char gstin_valid
Luhn checksum (payment cards)luhn_valid
Define a PII detectornew_detector
Record where PII is, for an inventorypii_inventory
Decide and apply a policy to a requestpolicy_apply policy_decide
Preview what would be redactedpreview
Redact PII from textredact
Redact a Parquet file, batch by batchredact_parquet
Redact the result of a database query into a tableredact_query
Register a detectorregister_detector
Put the values behind tokens back into textrestore
Scan the columns of a data frame for PIIscan_pii
Generate synthetic Indian identifierssynth_indian_pii
Replace identifiers with tokens that can be restoredtokenise
Combine keyed vaultsvault_merge
Save a vault to an encrypted file, and open it againvault_open vault_save
Verhoeff checksum (used by Aadhaar and Aadhaar Virtual ID)verhoeff_check_digit verhoeff_valid
Write and read inventory filesread_inventory write_inventory