pii-redactor

Mask structured PII before sending text from n8n to an LLM and restore it afterwards.

Package Information

Released: 2 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.4.0-beta.1

Available Nodes

Documentation generating…

Documentation

n8n-nodes-pii-redactor

An n8n community node that masks supported structured personally identifiable
information (PII) before text is sent to an LLM, then restores the original
values in the LLM response.

This package is a best-effort privacy layer, not a guarantee that every form
of PII will be detected.

API access is required

This npm package contains the n8n node and its credential definition. It does
not contain or run the PII Redactor API.

To use the node, your PII Redactor service provider must give you:

  • An HTTPS Base URL.
  • An API key assigned to your n8n instance or organization.

The node will not work without valid API access. Do not create, share, or place
the API key directly in a workflow. Store it only in an n8n credential.

Supported PII

  • Email addresses, including IDN and punycode domains.
  • International and local phone numbers, including extensions.
  • Credit card numbers that pass the Luhn checksum.
  • IPv4 and IPv6 addresses, including CIDR notation.
  • IBAN account numbers.
  • Contextual national identifiers for 18 countries.

Names, postal addresses, and organizations are not currently detected.

Installation

From a self-hosted n8n instance:

  1. Open Settings > Community Nodes.
  2. Select Install.
  3. Enter n8n-nodes-pii-redactor@beta while the package is in beta.
  4. Accept the community node warning and complete the installation.
  5. Restart n8n if the node does not appear immediately.

For a manual installation:

npm install n8n-nodes-pii-redactor@beta

Restart n8n after a manual installation.

Basic workflow

Webhook -> PII Redactor (Redact) -> LLM -> PII Redactor (Restore) -> Response

The critical integration rule is:

Send only maskedText to the LLM. Never send the original input field.

The requestId returned by Redact must be preserved until Restore. A mapping
expires after the time reported in expiresIn and is consumed by the first
successful Restore operation.

Quick configuration

  1. Create an n8n credential named PII Redactor API.
  2. Enter the Base URL supplied by the email contact.
  3. Enter the API key supplied by the email contact.
  4. Add a PII Redactor node and select Redact.
  5. Send its maskedText output to your LLM.
  6. Add another PII Redactor node and select Restore.
  7. Pass the LLM response as Text and the original Redact requestId as
    Request ID.

See USER_GUIDE.md for complete setup, workflow, error handling,
limitations, and troubleshooting instructions.

Important limitations

  • Detection is best effort and can produce false positives or false negatives.
  • Local phone detection depends on the configured ISO country code.
  • National identifiers require explicit context.
  • Modified placeholders cannot be restored.
  • Duplicated restorable placeholders are rejected.
  • Expired or previously consumed mappings cannot be recovered.
  • n8n may retain original workflow inputs in execution history. Configure
    execution retention according to your privacy requirements.

Safe support requests

Never send real PII, API keys, complete request bodies, or full execution logs
in a support request. Use synthetic or manually anonymized examples.

Support contact: idrobo.developer@gmail.com

License

MIT

Discussion