This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Project renamed to pygovernor
svitch
DPDP-compliant AI data security for Indian enterprises.
Zero dependencies. Runs locally. Works with any LLM provider.
pip install svitch
PII Detection and Redaction
Detects and redacts Indian PII (Aadhaar, PAN, UPI, IFSC, mobile, GST, bank accounts) and global PII (email, IP) — entirely locally, no network calls.
import svitch
# Detect
entities = svitch.detect("Customer Aadhaar: 2345 6789 0123, PAN: ABCDE1234F")
# [Entity(type='AADHAAR', value='2345 6789 0123', ...), Entity(type='PAN', ...)]
# Redact (token replacement)
result = svitch.redact("Call me on 9876543210, UPI: rahul@okicici")
result.text # "Call me on [MOBILE_IN], UPI: [UPI_ID]"
result.count # 2
result.clean # False
# Redact (partial mask)
result = svitch.redact("Aadhaar: 2345 6789 0123", replacement="mask")
result.text # "Aadhaar: XXXX XXXX 0123"
Wrap any LLM client
PII is redacted from every prompt before it leaves your network, and from every response before it's stored or displayed.
import svitch, openai
client = svitch.wrap(openai.OpenAI())
# Use exactly like openai.OpenAI() — PII is handled automatically
response = client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "user",
"content": "Assess loan for Aadhaar 9876 5432 1098, PAN ABCDE1234F"
# ↑ redacted to [AADHAAR_IN], [PAN_IN] before reaching OpenAI
}]
)
Anthropic:
import svitch, anthropic
client = svitch.wrap(anthropic.Anthropic())
Agent Audit Trail
Records every agent decision in an immutable, hash-chained audit log.
Required by DPDP §8 and the RBI FREE AI Framework.
from svitch_tracer import SvitchTracer
tracer = SvitchTracer(agent_id="loan-processor-v2")
with tracer.run() as run:
run.data_access(
source="crm",
fields_accessed=["name", "income", "aadhaar"],
purpose="loan_processing",
data_principal_id="CUST-5821",
)
run.llm_call(
provider="openai",
model="gpt-4o",
prompt="Assess eligibility for [AADHAAR_IN] applicant", # already redacted
response="Eligible. Score: 72/100.",
redact_pii=True,
)
run.decision(
reason="Score above threshold (70)",
outcome="approve",
confidence=0.87,
)
# Human-in-the-loop checkpoint — required for high-risk decisions
run.human_checkpoint(
question="Approve ₹5L loan for this applicant?",
approved=True,
reviewer_id="anand.k",
)
# Verify the hash chain is intact
valid, err = run.verify()
assert valid, f"Audit chain broken: {err}"
Configuration
export SVITCH_TRACER_URL=https://agent-tracer.vercel.app # default (hosted)
# or point to your self-hosted Agent Tracer
Supported PII types
| Type | Pattern |
|---|---|
AADHAAR |
12-digit, masked and unmasked |
PAN |
ABCDE1234F format |
UPI_ID |
handle@provider |
IFSC |
11-character bank code |
MOBILE_IN |
6xxx–9xxx Indian mobile |
BANK_ACCOUNT |
9–18 digit account numbers |
GST |
22AAAAA0000A1Z5 |
EMAIL |
RFC 5322 |
IPV4 |
IPv4 addresses |
License
Apache 2.0 — svitch.ai · DPDP Guide · GitHub
Metadata
Release files for svitch 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| svitch-0.1.5.tar.gz | 20.4 kB | With provenance | Details for svitch-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| svitch-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for svitch-0.1.5-py3-none-any.whl |
Total release size: 44.9 kB
Release files / svitch-0.1.5.tar.gz
| Download URL | svitch-0.1.5.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f643ca0a1b47e72955fb39b896a69e7e05621f8a501b8a1acb6b9d0dd89d57a3
|
|
BLAKE2b-256 checksum How to use checksums |
78b183340591645a4e60560b1885ce9aa866548ddb2452010de5fdcb942440af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / svitch-0.1.5-py3-none-any.whl
| Download URL | svitch-0.1.5-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
447d44bba9d4d33a2b97326e94eee75c0527c5465bfc6b94633ffff3c39471c9
|
|
BLAKE2b-256 checksum How to use checksums |
060577e913d8d467f0ab639e598c343fb32d57839ec52079e31033baa3d6b8c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logSecurity for svitch 0.1.5
Provenance
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for svitch-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logA 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.