Scan text for PII and secrets locally (free)
pii_scan_textScan text locally for PII and secrets like emails, cards, API keys, and tokens before sending prompts, logs, or files to LLMs or third parties.
Instructions
WHAT: Detect PII (emails, phones, US SSNs, Luhn-valid cards, mod-97 IBANs, UK NINOs, IPv4/IPv6) and secrets (AWS/GitHub/GitLab/Slack/Stripe/Google/OpenAI/Anthropic/HF/npm/SendGrid/Twilio/Azure keys, JWTs, private keys, URL credentials, key=value secrets) in text. Runs 100% on your machine. WHEN: Before sending prompts, tickets, logs or files to an LLM or third party; to audit text for leaked credentials. Findings are paged across all documents. WHEN NOT: To get sanitized text use pii_redact_text. For person names/addresses (NER), public URLs or PDFs use pii_guard_documents (paid). Not for images (no OCR). COST: Free. Local regex/validators only; no network, no APIFY_TOKEN, nothing sent anywhere. RETURNS: Paged {count,total,offset,hasMore,nextOffset,meta:{documents:[{doc_index,chars,finding_count,counts_by_type,risk_level}]},items:[{doc_index,type,category,rule,start,end,confidence,masked}]}. Raw values are never returned. Errors: INPUT_TOO_LARGE. EXAMPLE: {"texts":["Mail jane@acme.com, key AKIAIOSFODNN7EXAMPLE"]} -> 2 findings: EMAIL (masked "j***@a***.com"), AWS_ACCESS_KEY; risk_level "critical".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Page size: items to return, integer 1-1000 (default 100) | |
| texts | Yes | Required. 1-50 documents (prompt, chat message, log, file content), each <= 200,000 chars, total <= 500,000 chars. Example: ["Mail jane@acme.com, key AKIAIOSFODNN7EXAMPLE"] | |
| offset | No | Items to skip for paging, integer >= 0 (default 0); pass nextOffset from the previous response | |
| allowList | No | Exact values never flagged (case-insensitive), e.g. ["support@yourco.com"]. Default [] | |
| entityTypes | No | Only report these types, e.g. ["EMAIL","CREDIT_CARD","AWS_ACCESS_KEY"]. Omit = all local detectors. Valid names: pii_list_detectors | |
| entropyScan | No | Also flag unlabeled random-looking 20-200 char tokens as HIGH_ENTROPY_STRING (default false; may flag hashes/IDs) | |
| defaultPhoneRegion | No | ISO 3166-1 alpha-2 region for phones without +prefix, e.g. "US" (default), "DE", "GB" | US |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | No | Tool-specific context (summary counts, cost notes, ...) | |
| count | Yes | Number of items in this page | |
| items | Yes | Result rows for this page | |
| total | Yes | Total items before paging | |
| offset | Yes | Offset of the first item in this page | |
| hasMore | Yes | True if more items exist after this page | |
| nextOffset | Yes | Offset to pass for the next page, or null |