Redact PII and secrets locally (free)
pii_redact_textRedact PII and secrets from text locally before sending it to LLMs or third parties, replacing findings with placeholders, masks, or salted hashes.
Instructions
WHAT: Return sanitized copies of texts with every local PII/secret finding replaced (placeholder [EMAIL_1], mask, or salted hash). Placeholders are consistent across documents in one call. Runs 100% on your machine. WHEN: Right before sending user data to an LLM/third party. Use returnPlaceholderMap=true if you need to restore originals in the LLM answer later (do the restore yourself by string replacement). WHEN NOT: For a findings report only use pii_scan_text. For names/addresses NER, URLs or PDFs use pii_guard_documents (paid). COST: Free. Local only; no network, no token. RETURNS: Paged {count,total,...,items:[{type:"redacted_document",doc_index,chars,finding_count,counts_by_type,risk_level,output_text}],meta:{placeholder_map?}}. One item per document (page with limit/offset). placeholder_map contains the ORIGINAL sensitive values; omit unless needed. Errors: INPUT_TOO_LARGE. EXAMPLE: {"texts":["Call +1 415 555 0100 or mail jane@acme.com"]} -> output_text "Call [PHONE_1] or mail [EMAIL_1]".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Page size: items to return, integer 1-50 (default 10) | |
| 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) | |
| redactionStyle | No | "placeholder" (default) = [EMAIL_1]; "mask" = j***@a***.com; "hash" = [EMAIL:3f2a9c0d1b7e] (random per-call salt) | placeholder |
| defaultPhoneRegion | No | ISO 3166-1 alpha-2 region for phones without +prefix, e.g. "US" (default), "DE", "GB" | US |
| returnPlaceholderMap | No | Default false. If true (placeholder style), meta.placeholder_map maps "[EMAIL_1]" -> original value |
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 |