Skip to main content Switch to mobile version dpdp-rag-audit 0.2.0 Automated compliance linter and privacy scanner for RAG knowledge bases under India DPDP Act 2023 and GDPR
pip install dpdp-rag-audit Copy PIP instructions
Automated compliance linter and privacy scanner for RAG knowledge bases and vector stores under India's Digital Personal Data Protection Act (DPDP Act 2023) and GDPR.
Why DPDP Compliance Matters for RAG
Under India's DPDP Act 2023 (Section 4 & 6) and GDPR (Article 5 & 17), personal data processed in enterprise systems must adhere to strict purpose limitation, data minimization, and consent validation.
Embedding un-sanitized documents containing Indian identifiers into vector databases exposes organizations to substantial non-compliance liability and unauthorized data aggregation.
Mathematical Checksum Validation: Validates 12-digit Aadhaar numbers using the Verhoeff algorithm to eliminate ~90% of numeric false positives.
Indian Identifier Scanning: Detects Aadhaar, PAN (with spaced/hyphenated OCR handling), GSTIN, Indian mobile numbers, UPI VPAs, Voter IDs (EPIC), Indian Driving Licenses (MoRTH state-code validated), and Passports.
Native Vector Store Scanner: Directly audits SQLite vector stores (e.g. ChromaDB's chroma.sqlite3) without requiring external DB servers.
Metadata Governance Linting: Verifies consent verification and purpose declarations attached to vector chunks.
Automated Redactor: Masks personal data before document ingestion into vector databases.
git clone https://github.com/ashishdhillon/dpdp-rag-audit.git cd dpdp-rag-audit pip install -e . Scan documents, vector stores, or raw chunks:
# Run on built-in demo corpus dpdp-rag-audit scan --demo # Scan a directory of RAG documents (.txt, .md, .json) dpdp-rag-audit scan docs/ # Audit ChromaDB SQLite vector store directly dpdp-rag-audit scan-db /path/to/chroma.sqlite3 # Redact identifiers in a file before indexing dpdp-rag-audit redact raw_kb.md -o clean_kb.md Sample Audit Output
┌────────────────────────────────────────────────────────────┐ │ DPDP & GDPR RAG COMPLIANCE AUDIT │ ├────────────────────────────────────────────────────────────┤ │ Scanned Chunks: 3 Compliant: 1 Violations: 3 │ │ Compliance Status: NON_COMPLIANT │ ├────────────────────────────────────────────────────────────┤ │ Privacy Deficiencies Identified: │ │ 1. [CRITICAL] Aadhaar Number (DPDP-ID-01) │ │ Found: 2345 XXXX 0124 │ │ 2. [HIGH] PAN Number (DPDP-ID-02) │ │ Found: ABXXX4F │ │ 3. [MEDIUM] Indian Mobile Number (DPDP-ID-04) │ │ Found: 98XXXXXX10 │ └────────────────────────────────────────────────────────────┘ Python API Usage
from dpdp_rag_audit import DPDPScanner, redact_identifiers scanner = DPDPScanner() chunk = "Candidate Aadhaar: 2345 6789 0124, PAN: ABCDE1234F" violations = scanner.scan_chunk(chunk) for v in violations: print(f"[{v.severity}] {v.identifier_type}: {v.description}") # Automatic masking clean_chunk, count = redact_identifiers(chunk) print(clean_chunk) # "Candidate Aadhaar: [REDACTED:AADHAAR], PAN: [REDACTED:PAN]" Academic & Regulatory References
This project grounds its threat model and auditing methodology in peer-reviewed literature and statutory standards:
Carlini et al. (USENIX Security 2021): Extracting Training Data from Large Language Models
Li et al. (IEEE 2023): Privacy in Large Language Models: A Survey
Raji et al. (ACM FAccT 2020): Closing the AI Accountability Gap: Defining an End-to-End Framework for Internal Algorithmic Auditing
Verhoeff (1969): Error Detecting Decimal Codes (Dihedral Group D5)
Digital Personal Data Protection Act, 2023: Gazette of India Act No. 22 of 2023
For full BibTeX entries and citations, see REFERENCES.md.
dpdp-act gdpr rag privacy-compliance pii-redaction ai-governance vector-database
Development Status 4 - Beta
Intended Audience Developers
License OSI Approved :: MIT License
Programming Language Python :: 3
Release files for dpdp-rag-audit 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 32.0 kB
Release files / dpdp_rag_audit-0.2.0.tar.gz
Release files / dpdp_rag_audit-0.2.0-py3-none-any.whl
Security for dpdp-rag-audit 0.2.0
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 26, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




