n8n-nodes-redactor 1.10.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +21 -42
  2. package/README.md +114 -399
  3. package/dist/nodes/{PiiRedactor/PiiRedactor.node.d.ts → Redactor/Redactor.node.d.ts} +1 -1
  4. package/dist/nodes/{PiiRedactor/PiiRedactor.node.js → Redactor/Redactor.node.js} +150 -191
  5. package/dist/nodes/{PiiRedactor → Redactor}/audit.d.ts +0 -26
  6. package/dist/nodes/{PiiRedactor → Redactor}/audit.js +5 -52
  7. package/dist/nodes/Redactor/classification.d.ts +13 -0
  8. package/dist/nodes/{PiiRedactor → Redactor}/classification.js +0 -31
  9. package/dist/nodes/Redactor/context.d.ts +7 -0
  10. package/dist/nodes/{PiiRedactor → Redactor}/context.js +10 -72
  11. package/dist/nodes/Redactor/encryption.d.ts +4 -0
  12. package/dist/nodes/{PiiRedactor → Redactor}/encryption.js +8 -53
  13. package/dist/nodes/{PiiRedactor → Redactor}/engine.d.ts +0 -17
  14. package/dist/nodes/{PiiRedactor → Redactor}/engine.js +20 -230
  15. package/dist/nodes/Redactor/injection.d.ts +20 -0
  16. package/dist/nodes/{PiiRedactor → Redactor}/injection.js +4 -57
  17. package/dist/nodes/Redactor/names.d.ts +8 -0
  18. package/dist/nodes/{PiiRedactor → Redactor}/names.js +0 -34
  19. package/dist/nodes/{PiiRedactor → Redactor}/patterns.d.ts +0 -9
  20. package/dist/nodes/{PiiRedactor → Redactor}/patterns.js +50 -159
  21. package/dist/nodes/Redactor/presidio.d.ts +27 -0
  22. package/dist/nodes/{PiiRedactor → Redactor}/presidio.js +0 -48
  23. package/dist/nodes/{PiiRedactor → Redactor}/profiles.d.ts +0 -24
  24. package/dist/nodes/{PiiRedactor → Redactor}/profiles.js +3 -29
  25. package/dist/nodes/Redactor/pseudonymize.d.ts +1 -0
  26. package/dist/nodes/{PiiRedactor → Redactor}/pseudonymize.js +0 -27
  27. package/dist/nodes/Redactor/redactor.dark.svg +1 -0
  28. package/dist/nodes/Redactor/redactor.svg +1 -0
  29. package/dist/nodes/{PiiRedactor → Redactor}/ropa.d.ts +0 -12
  30. package/dist/nodes/{PiiRedactor → Redactor}/ropa.js +2 -20
  31. package/dist/nodes/{PiiRedactor → Redactor}/types.d.ts +0 -11
  32. package/dist/nodes/{PiiRedactor → Redactor}/types.js +0 -1
  33. package/dist/nodes/{PiiRedactor → Redactor}/vault.d.ts +0 -8
  34. package/dist/nodes/{PiiRedactor → Redactor}/vault.js +4 -41
  35. package/package.json +34 -15
  36. package/README.dev.md +0 -443
  37. package/README.npm.md +0 -443
  38. package/dist/nodes/PiiRedactor/__tests__/encryption.test.d.ts +0 -1
  39. package/dist/nodes/PiiRedactor/__tests__/encryption.test.js +0 -200
  40. package/dist/nodes/PiiRedactor/__tests__/engine.test.d.ts +0 -1
  41. package/dist/nodes/PiiRedactor/__tests__/engine.test.js +0 -524
  42. package/dist/nodes/PiiRedactor/__tests__/operations.test.d.ts +0 -1
  43. package/dist/nodes/PiiRedactor/__tests__/operations.test.js +0 -316
  44. package/dist/nodes/PiiRedactor/__tests__/patterns-global.test.d.ts +0 -1
  45. package/dist/nodes/PiiRedactor/__tests__/patterns-global.test.js +0 -427
  46. package/dist/nodes/PiiRedactor/__tests__/patterns.test.d.ts +0 -1
  47. package/dist/nodes/PiiRedactor/__tests__/patterns.test.js +0 -481
  48. package/dist/nodes/PiiRedactor/__tests__/phase1.test.d.ts +0 -1
  49. package/dist/nodes/PiiRedactor/__tests__/phase1.test.js +0 -343
  50. package/dist/nodes/PiiRedactor/__tests__/phase3.test.d.ts +0 -1
  51. package/dist/nodes/PiiRedactor/__tests__/phase3.test.js +0 -275
  52. package/dist/nodes/PiiRedactor/__tests__/phase4.test.d.ts +0 -1
  53. package/dist/nodes/PiiRedactor/__tests__/phase4.test.js +0 -184
  54. package/dist/nodes/PiiRedactor/__tests__/presidio.test.d.ts +0 -1
  55. package/dist/nodes/PiiRedactor/__tests__/presidio.test.js +0 -170
  56. package/dist/nodes/PiiRedactor/__tests__/security.test.d.ts +0 -1
  57. package/dist/nodes/PiiRedactor/__tests__/security.test.js +0 -178
  58. package/dist/nodes/PiiRedactor/__tests__/semantic.test.d.ts +0 -1
  59. package/dist/nodes/PiiRedactor/__tests__/semantic.test.js +0 -319
  60. package/dist/nodes/PiiRedactor/__tests__/vault.test.d.ts +0 -1
  61. package/dist/nodes/PiiRedactor/__tests__/vault.test.js +0 -247
  62. package/dist/nodes/PiiRedactor/classification.d.ts +0 -33
  63. package/dist/nodes/PiiRedactor/context.d.ts +0 -57
  64. package/dist/nodes/PiiRedactor/encryption.d.ts +0 -45
  65. package/dist/nodes/PiiRedactor/injection.d.ts +0 -46
  66. package/dist/nodes/PiiRedactor/names.d.ts +0 -28
  67. package/dist/nodes/PiiRedactor/presidio.d.ts +0 -77
  68. package/dist/nodes/PiiRedactor/pseudonymize.d.ts +0 -20
  69. package/dist/nodes/PiiRedactor/redact.png +0 -0
  70. package/dist/nodes/PiiRedactor/redact.svg +0 -3
package/LICENSE CHANGED
@@ -1,42 +1,21 @@
1
- Fair Use Code License (FUCL)
2
-
3
- Copyright (c) 2026 Mirza Iqbal / next8n (https://next8n.com). All rights reserved.
4
-
5
- This software is published as an n8n community node for the benefit of the n8n
6
- ecosystem and teams building AI workflows that need to handle customer data
7
- responsibly. However, the intellectual property, source code, and all associated
8
- rights are owned exclusively by the copyright holder.
9
-
10
- PERMITTED:
11
-
12
- - Install and use this software for your own internal workflows and
13
- business automation.
14
-
15
- PROHIBITED WITHOUT EXPLICIT WRITTEN CONSENT:
16
-
17
- - Copying, forking, or reproducing the source code in any form
18
- - Commercial redistribution, resale, sublicensing, or white-labeling
19
- - Creating derivative works or competing products based on this code
20
- - Public redistribution of modified or unmodified versions
21
- - Using the Software as part of a commercial service offering
22
- - Removing or altering copyright notices or attribution
23
-
24
- ATTRIBUTION:
25
-
26
- This software was developed and is actively maintained by next8n
27
- (https://next8n.com). Attribution must be preserved in all copies.
28
-
29
- DISCLAIMER:
30
-
31
- THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
- SOFTWARE.
38
-
39
- We built it. We maintain it. We own the rights to the code.
40
-
41
- For commercial licensing, partnership, or custom development:
42
- https://services.next8n.com
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mirza Iqbal / next8n (https://next8n.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,443 +1,158 @@
1
1
  <p align="center">
2
- <img src="https://unpkg.com/n8n-nodes-redactor@1.0.2/dist/nodes/PiiRedactor/redact.png" alt="Redactor" width="80" />
2
+ <img src="https://raw.githubusercontent.com/mjmirza/n8n-nodes-redactor/master/.github/assets/logo.png" alt="Redactor" width="96" />
3
3
  </p>
4
4
 
5
5
  <h1 align="center">n8n-nodes-redactor</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>Stop sending your customer data to OpenAI, Claude, and Gemini unprotected.</strong><br/>
9
- Built, maintained, and owned by <a href="https://next8n.com">next8n</a>
8
+ <strong>Keep personal data out of OpenAI, Claude and Gemini while your n8n AI workflows keep working.</strong><br/>
9
+ Built and maintained by <a href="https://next8n.com">next8n</a>
10
10
  </p>
11
11
 
12
12
  <p align="center">
13
- <a href="https://www.npmjs.com/package/n8n-nodes-redactor"><img src="https://img.shields.io/npm/v/n8n-nodes-redactor?style=for-the-badge&color=CB3837&label=npm" alt="npm version" /></a>
14
- <a href="https://www.npmjs.com/package/n8n-nodes-redactor"><img src="https://img.shields.io/npm/dt/n8n-nodes-redactor?style=for-the-badge&color=blue&label=downloads" alt="npm downloads" /></a>
15
- <a href="#license"><img src="https://img.shields.io/badge/license-FUCL-orange?style=for-the-badge" alt="License" /></a>
16
- <img src="https://img.shields.io/badge/PII_Types-216+-success?style=for-the-badge" alt="216+ PII Types" />
17
- <img src="https://img.shields.io/badge/Tests-426_Passed-brightgreen?style=for-the-badge" alt="426 Tests Passed" />
18
- <img src="https://img.shields.io/badge/Categories-12-success?style=for-the-badge" alt="12 Categories" />
19
- <img src="https://img.shields.io/badge/Countries-35+-success?style=for-the-badge" alt="35+ Countries" />
20
- <img src="https://img.shields.io/badge/Operations-8-success?style=for-the-badge" alt="8 Operations" />
21
- <img src="https://img.shields.io/badge/Vault-AES--256--GCM_Encrypted-7B61FF?style=for-the-badge" alt="AES-256-GCM Vault" />
22
- <img src="https://img.shields.io/badge/Presidio-NLP_Optional-7B61FF?style=for-the-badge" alt="Presidio NLP" />
23
- <img src="https://img.shields.io/badge/Vault-Reversible-7B61FF?style=for-the-badge" alt="Reversible Vault" />
24
- <img src="https://img.shields.io/badge/GDPR-Ready-00C4B4?style=for-the-badge" alt="GDPR Ready" />
25
- <img src="https://img.shields.io/badge/HIPAA-Ready-00C4B4?style=for-the-badge" alt="HIPAA Ready" />
26
- <img src="https://img.shields.io/badge/100%25-Local_Processing-10A37F?style=for-the-badge" alt="100% Local" />
27
- <img src="https://img.shields.io/badge/n8n-Community_Node-FF6D5A?style=for-the-badge" alt="n8n Community Node" />
28
- <img src="https://img.shields.io/badge/AI_Agent-Compatible-10A37F?style=for-the-badge" alt="AI Agent Compatible" />
29
- <img src="https://img.shields.io/badge/TypeScript-Strict-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
30
- <img src="https://img.shields.io/badge/Maintained-Active-brightgreen?style=for-the-badge" alt="Actively Maintained" />
13
+ <a href="https://www.npmjs.com/package/n8n-nodes-redactor"><img src="https://img.shields.io/npm/v/n8n-nodes-redactor?label=npm" alt="npm version" /></a>
14
+ <a href="https://www.npmjs.com/package/n8n-nodes-redactor"><img src="https://img.shields.io/npm/dm/n8n-nodes-redactor?label=downloads" alt="npm downloads" /></a>
15
+ <a href="https://github.com/mjmirza/n8n-nodes-redactor/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/mjmirza/n8n-nodes-redactor/ci.yml?branch=master&label=CI" alt="CI status" /></a>
16
+ <a href="https://www.npmjs.com/package/n8n-nodes-redactor#provenance"><img src="https://img.shields.io/badge/npm-provenance%20signed-brightgreen" alt="npm provenance" /></a>
17
+ <a href="#license"><img src="https://img.shields.io/npm/l/n8n-nodes-redactor" alt="MIT License" /></a>
18
+ <img src="https://img.shields.io/badge/PII%20patterns-216-blue" alt="216 PII patterns" />
19
+ <img src="https://img.shields.io/badge/n8n-self--hosted-FF6D5A" alt="Self-hosted n8n" />
31
20
  </p>
32
21
 
33
- ---
22
+ ## What you get
34
23
 
35
- ## Your customer data is leaving your server right now.
24
+ - **Personal data never reaches the model.** Emails, phone numbers, IBANs, card numbers, national IDs and 200 more kinds of data are swapped for safe tokens before the LLM call.
25
+ - **The answer still makes sense.** After the model replies, the node puts the real values back, so your output reads naturally.
26
+ - **Fewer false alarms.** Card numbers are Luhn checked, IBANs checksum verified, NHS numbers mod 11 validated, so random digits are left alone.
27
+ - **Proof for your records.** An optional audit report, and a GDPR Article 30 processing record built from each run.
28
+ - **No new vendor.** Everything runs inside your own n8n. No cloud service, no API key, no runtime dependency.
36
29
 
37
- Every time your n8n workflow sends a customer email, phone number, address, IBAN, or credit card to OpenAI or Claude - **that data is gone**. You don't control it anymore. Your customer didn't consent to it. And under GDPR, **you're liable**.
30
+ ## From install to first result
38
31
 
39
- You know this is a problem. Your clients know it too. But rebuilding every workflow to strip PII manually? That's weeks of work nobody has time for.
32
+ 1. In n8n open **Settings**, then **Community Nodes**, enter `n8n-nodes-redactor` and install.
33
+ 2. Add a **Redactor** node before your OpenAI, Claude or Gemini node and set the operation to **Redact**.
34
+ 3. Add a second **Redactor** node after the model and set it to **Restore**.
35
+ 4. Run the workflow. Both nodes share the execution ID as Session ID, so a full run works with no extra setup. When testing one node at a time, set the same fixed Session ID, for example `test-1`, on both.
40
36
 
41
- **This node fixes it in 2 minutes.**
37
+ The model receives tokens instead of personal data.
42
38
 
43
- Drop it between your data source and your LLM node. It automatically detects and replaces 200+ types of sensitive data with safe tokens. The LLM processes the clean data. Then the node swaps the original values back in. Your customer data never leaves your server.
44
-
45
- No cloud service. No API keys. No third-party dependency. Everything runs locally on your machine.
46
-
47
- <p align="center">
48
- <a href="https://services.next8n.com"><img src="https://img.shields.io/badge/Need_Help_Setting_Up%3F-Book_a_Free_Call-FF6D5A?style=for-the-badge&logoColor=white" alt="Book a consultation" /></a>
49
- </p>
50
-
51
- ---
52
-
53
- ## How it works
54
-
55
- ```
56
- [Your Data] --> [PII Redactor: REDACT] --> [OpenAI / Claude / Gemini] --> [PII Redactor: RESTORE] --> [Clean Output]
57
- ```
58
-
59
- **Before the LLM sees it:**
60
39
  ```json
61
- {
62
- "message": "Mrs. Sarah Johnson (sarah@bigcorp.com) reported a billing issue. SSN: 987-65-4321"
63
- }
40
+ { "message": "[PERSON_0] ([EMAIL_1]) reported a billing issue. SSN [SSN_2]" }
64
41
  ```
65
42
 
66
- **What the LLM actually receives:**
67
- ```json
68
- {
69
- "message": "[PERSON_0] ([EMAIL_1]) reported a billing issue. SSN: [SSN_2]"
70
- }
71
- ```
43
+ After Restore, your workflow gets the real values back.
72
44
 
73
- **After the LLM responds, the node restores everything automatically:**
74
45
  ```json
75
- {
76
- "reply": "I've resolved the billing issue for Mrs. Sarah Johnson. A confirmation has been sent to sarah@bigcorp.com."
77
- }
78
- ```
79
-
80
- The LLM never saw the real data. Your customer never knew the difference.
81
-
82
- ---
83
-
84
- ## What it detects (125+ sensitive data types across 11 categories)
85
-
86
- ### Contact Information
87
- | Type | Examples |
88
- |------|----------|
89
- | Email | `john@company.com`, `user+tag@sub.domain.co.uk` |
90
- | Phone | `(555) 123-4567`, `+49 30 1234-5678` |
91
- | UK Phone | `020 7946 0958`, `+44 7911 123456` |
92
- | Person Names | `Mr. John Smith`, `Dr. Anna Wilson`, `Frau Weber`, `Señor García` |
93
-
94
- ### Financial Data
95
- | Type | Validation |
96
- |------|------------|
97
- | Credit Cards | Luhn algorithm verified - rejects random 16-digit numbers |
98
- | IBAN | ISO 13616 checksum verified - rejects invalid checksums |
99
- | BIC/SWIFT | `DEUTDEFF`, `DEUTDEFF500` |
100
- | EU VAT Numbers | All 27 EU member states covered |
101
- | UK Bank Accounts | Sort code + account number |
102
-
103
- ### Government IDs
104
- | Type | Coverage |
105
- |------|----------|
106
- | US SSN | `123-45-6789` |
107
- | US/EU Passports | `C12345678`, `AB1234567` |
108
- | UK NHS Numbers | With mod-11 checksum validation |
109
- | German National ID | 10-character format |
110
- | US EIN | `12-3456789` |
111
- | US Driver License | Common format |
112
-
113
- ### Network & Digital
114
- | Type | Examples |
115
- |------|----------|
116
- | IPv4 / IPv6 | `192.168.1.1`, full IPv6 |
117
- | MAC Addresses | `00:1A:2B:3C:4D:5E` |
118
- | URLs | Any `http://` or `https://` URL |
119
- | Bitcoin Addresses | Legacy (`1...`) and Bech32 (`bc1...`) |
120
- | Ethereum Addresses | `0x742d35Cc...` |
121
-
122
- ### Location & Dates
123
- | Type | Examples |
124
- |------|----------|
125
- | US ZIP Codes | `90210`, `90210-1234` |
126
- | UK Postcodes | `SW1A 1AA`, `EC1A1BB` |
127
- | GPS Coordinates | `51.5074, -0.1278` |
128
- | Dates | `15/03/1990`, `2024-03-15`, `15.03.1990` |
129
- | Dates of Birth | `DOB: 15/03/1990` |
130
-
131
- ### Medical & Compliance
132
- | Type | Examples |
133
- |------|----------|
134
- | Medical Record Numbers | `MRN: 12345678`, `MRN#987654` |
135
-
136
- ### Government IDs (25+ countries)
137
- | Country | Types |
138
- |---------|-------|
139
- | USA | SSN, ITIN, EIN, Driver License (contextual), Passport |
140
- | Canada | SIN (Luhn validated) |
141
- | UK | NINO, NHS (mod-11 checksum), Passport |
142
- | Germany | Personalausweis, Steuer-ID, Sozialversicherungsnummer, Reisepass, Handelsregister (HRB) |
143
- | Austria | Sozialversicherungsnummer (date validated) |
144
- | Switzerland | AHV/AVS number |
145
- | France | NIR (social security) |
146
- | Italy | Codice Fiscale, Carta d'Identita |
147
- | Spain | DNI, NIE, NIF |
148
- | Netherlands | BSN (11-check validated) |
149
- | Belgium | Rijksregisternummer |
150
- | Poland | PESEL (checksum validated) |
151
- | Sweden | Personnummer |
152
- | Norway | Fodselsnummer |
153
- | Denmark | CPR-nummer |
154
- | Finland | Henkilotunnus (HETU) |
155
- | Portugal | NIF (checksum validated) |
156
- | Ireland | PPS Number |
157
- | Australia | TFN (checksum validated), Medicare |
158
- | New Zealand | IRD Number |
159
- | Japan | My Number |
160
- | South Korea | RRN |
161
- | Singapore | NRIC/FIN |
162
- | India | Aadhaar, PAN |
163
- | Brazil | CPF |
164
-
165
- ### Enterprise and Infrastructure
166
- | Type | Examples |
167
- |------|----------|
168
- | Internal Hostnames | `server-web-01.internal`, `db-prod.corp.local`, `nas.lan` |
169
- | Windows UNC Paths | `\\fileserver\shared\docs` |
170
- | LDAP Distinguished Names | `CN=John,OU=Users,DC=corp,DC=local` |
171
- | Active Directory Users | `CORP\jsmith` |
172
- | Private IPs (RFC 1918) | `10.0.1.50`, `172.16.0.1`, `192.168.1.1` |
173
- | Database Connection Strings | JDBC, MongoDB, PostgreSQL, MySQL, Redis, MSSQL |
174
- | API Keys | AWS (`AKIA...`), GCP (`AIza...`), Stripe, OpenAI, GitHub, Slack |
175
- | Auth Tokens | Bearer tokens, JWT tokens |
176
- | Cryptographic Material | PEM private keys, SSH public keys |
177
- | Secrets in Config | `password=`, `api_key=`, `secret=`, `token=` patterns |
178
- | Azure Keys | Storage keys, SAS tokens |
179
- | Slack Webhooks | `hooks.slack.com/services/...` |
180
-
181
- ### Vehicle
182
- | Type | Examples |
183
- |------|----------|
184
- | VIN | `1HGBH41JXMN109186` (17-character) |
185
- | License Plates | German (`M AB 1234`), UK (`AB12 CDE`), French (`AB-123-CD`) |
186
-
187
- ### Biometric and Digital Identity
188
- | Type | Examples |
189
- |------|----------|
190
- | UUID/GUID | `550e8400-e29b-41d4-a716-446655440000` |
191
- | Social Media Handles | `@username` |
192
- | IMEI | Device identifiers |
193
- | ICCID | SIM card numbers |
194
-
195
- ### Custom Business Identifiers
196
- Add your own patterns for anything specific to your business:
197
- | Example | Regex |
198
- |---------|-------|
199
- | Order IDs | `ORD-\d{6}` |
200
- | SKU Codes | `SKU-[A-Z0-9]{8}` |
201
- | Ticket Numbers | `TICKET-\d+` |
202
-
203
- ---
204
-
205
- ## 8 Operations: When to use what
206
-
207
- | Operation | When to use it | What it does | Example workflow |
208
- |-----------|---------------|-------------|-----------------|
209
- | **Redact** | Before sending data to an LLM, API, or third-party service | Detects and replaces all sensitive data with safe tokens. Stores originals in vault for later restoration. Also includes prompt injection detection. | `[Data Source] > Redact > [OpenAI] > Restore > [Output]` |
210
- | **Restore** | After the LLM or service has processed the tokenized data | Swaps all tokens back to original values using the vault. Your output has real data again. | Place after your LLM node, before the final output. |
211
- | **Detect** | Compliance audits, data assessment, before deciding to redact | Scans all data for sensitive information and returns a full report. Does NOT modify the data. Use this to understand what PII exists. | `[Data Source] > Detect > [If PII found] > Redact` |
212
- | **Verify** | After redaction, to confirm nothing leaked through | Re-scans redacted output to check if any PII slipped past. Returns PASS or FAIL with details of any leaks. Defense-in-depth. | `[Data Source] > Redact > [LLM] > Verify > [Alert if FAIL]` |
213
- | **Classify** | Data governance, sensitivity labeling, routing decisions | Assigns sensitivity labels (PUBLIC / INTERNAL / CONFIDENTIAL / RESTRICTED) based on what PII categories are found. Includes escalation rules. | `[Data Source] > Classify > [If RESTRICTED] > Block` |
214
- | **Purge** | GDPR right to erasure, cleanup, end of workflow | Deletes vault sessions from memory or disk. Ensures no PII mapping data remains after processing. Required for GDPR Article 17 compliance. | `[End of workflow] > Purge` |
215
- | **Stats** | Debugging, monitoring, admin | Shows all active vault sessions with entry counts, creation times, TTL, and vault storage type. | Run manually to inspect vault state. |
216
- | **ROPA Report** | GDPR Article 30 compliance | Generates structured Records of Processing Activities covering all 8 fields required by GDPR Art.30(1). Auto-populated from redaction results. | After Redact, generate compliance documentation. |
217
-
218
- **Recommended workflow for production:**
46
+ { "reply": "I resolved the billing issue for Mrs. Sarah Johnson and sent a confirmation to sarah@bigcorp.com." }
219
47
  ```
220
- [Data Source] > Detect (assess) > Redact (protect) > [LLM] > Verify (confirm) > Restore (recover) > [Output] > Purge (cleanup)
221
- ```
222
-
223
- ---
224
48
 
225
- ## 7 Redaction Modes
49
+ ## Compatibility
226
50
 
227
- Choose the right mode for your use case:
51
+ | Environment | Status |
52
+ |---|---|
53
+ | Self-hosted n8n 1.x and 2.x | Supported |
54
+ | n8n Cloud | Not available |
55
+ | n8n verified community nodes | Not eligible |
228
56
 
229
- | Mode | Output | Reversible? | Best for |
230
- |------|--------|-------------|----------|
231
- | **Token** | `[EMAIL_0]` | Yes | LLM workflows (recommended) |
232
- | **Mask** | `j***@e***.com` | No | Logs, dashboards, support tickets |
233
- | **Hash** | `[EMAIL:a3f2b8c91d4e]` | No | Analytics, deduplication |
234
- | **Redact** | `[REDACTED]` | No | Maximum privacy, audit trails |
235
- | **Pseudonymize** | `sarah.miller@example.com` | Yes | GDPR pseudonymization, demo data, QA environments |
236
- | **Blackout** | `████████` | No | Visual censoring, document redaction, like a black marker |
237
- | **Remove** | *(empty string)* | No | Complete deletion, no trace left, total removal |
57
+ The persistent vault, encrypted vault files and JSONL audit log write to the local disk. n8n Cloud and n8n's verification program do not allow community nodes to use the file system, so this node is self-hosted only by design.
238
58
 
239
- ---
59
+ ## Operations
240
60
 
241
- ## Smart features that matter
61
+ | Operation | Use it when | What it does |
62
+ |---|---|---|
63
+ | Redact | Before an LLM, API or third party | Replaces sensitive values with tokens, stores originals in the vault, and checks the input for prompt injection |
64
+ | Restore | After the model or service replies | Swaps tokens back to the original values |
65
+ | Detect | Assessing data before deciding | Reports what personal data exists without changing anything |
66
+ | Verify | After redaction | Rescans the output and returns PASS or FAIL with any leaked values |
67
+ | Classify | Governance and routing | Labels data PUBLIC, INTERNAL, CONFIDENTIAL or RESTRICTED |
68
+ | Purge | Erasure requests and cleanup | Deletes vault sessions from memory or disk, supporting GDPR Article 17 |
69
+ | Stats | Debugging | Lists active vault sessions with entry counts and TTL |
242
70
 
243
- ### Deduplication
244
- When the same email appears in 5 fields, it gets the same token (`[EMAIL_0]`) everywhere. The LLM understands it's the same person. Relationships in your data are preserved.
71
+ The recommended production chain looks like this.
245
72
 
246
- ### Field Targeting
247
- Don't want to scan internal IDs or metadata? Use allowlist or denylist mode:
248
- - **Allowlist:** Only scan `user.email`, `*.phone`, `contacts[*].name`
249
- - **Denylist:** Skip `internalId`, `metadata.*`, `debug`
250
-
251
- ### Persistent Vault
252
- Choose between in-memory (fast, lost on restart) or file-based vault (survives n8n restarts). File vault stores mappings in `~/.n8n/pii-vault/`. Sessions auto-expire based on TTL.
253
-
254
- ### Session TTL
255
- Vault sessions auto-expire after 60 minutes by default. No unbounded memory growth. Configurable per workflow.
256
-
257
- ### Audit Report
258
- Enable the second output to get a full compliance trail:
259
- ```json
260
- {
261
- "totalHits": 7,
262
- "hitsByCategory": { "contact": 3, "identity": 2, "financial": 2 },
263
- "hitsByPattern": { "EMAIL": 2, "PHONE": 1, "SSN": 1, "CREDIT_CARD": 1, "PERSON": 2 },
264
- "hits": [...]
265
- }
266
73
  ```
267
-
268
- ### Validation - Not Just Regex
269
- Credit card numbers are **Luhn-checked**. IBANs are **checksum-verified** (ISO 13616). NHS numbers pass **mod-11 validation**. This means fewer false positives and less over-redaction that kills your LLM output quality.
270
-
271
- ---
272
-
273
- ## Installation
274
-
275
- ### From n8n (Recommended)
276
- 1. Go to **Settings > Community Nodes**
277
- 2. Enter `n8n-nodes-redactor`
278
- 3. Click **Install**
279
- 4. Done. The "Redactor" node appears in your node palette.
280
-
281
- ### Manual
282
- ```bash
283
- cd ~/.n8n/nodes
284
- npm install n8n-nodes-redactor
285
- # Restart n8n
74
+ Data source > Detect > Redact > LLM > Verify > Restore > Output > Purge
286
75
  ```
287
76
 
288
- ---
289
-
290
- ## Quick Start (2 minutes)
291
-
292
- 1. **Install** the node
293
- 2. **Add "Redactor"** to your workflow, set operation to **Redact**
294
- 3. **Connect it** before your OpenAI/Claude/Gemini node
295
- 4. **Add another "Redactor"** after the LLM node, set operation to **Restore**
296
- 5. Both nodes share the same Session ID (defaults to execution ID - works automatically)
297
- 6. **Run your workflow.** Customer data stays on your server.
298
-
299
- That's it. No configuration needed for the default case.
300
-
301
- ---
302
-
303
- ## Who this is for
77
+ ## Redaction modes
304
78
 
305
- - **n8n consultants** building AI workflows for clients who ask "is our data safe?"
306
- - **Agencies** delivering GDPR-compliant automation for EU clients
307
- - **Companies** processing customer support tickets, emails, or documents through LLMs
308
- - **Healthcare** organizations that need HIPAA compliance before sending data to AI
309
- - **Anyone** who lies awake thinking about what happens when customer data hits an external API
310
-
311
- ---
312
-
313
- ## We build GDPR-compliant AI workflows. For a living.
314
-
315
- We've delivered n8n + AI automation for clients across **e-commerce**, **healthcare**, **financial services**, and **consulting**. The GDPR question around client data hitting external APIs keeps coming up. We built this node because we needed it for real client projects.
316
-
317
- **This node exists because we solve this problem every day.**
318
-
319
- If you need help setting up PII-safe AI workflows, custom redaction rules, or end-to-end GDPR-compliant automation - we've done it before and would be happy to do it for you.
320
-
321
- <p align="center">
322
- <a href="https://services.next8n.com"><img src="https://img.shields.io/badge/Book_a_Free_Consultation-services.next8n.com-FF6D5A?style=for-the-badge&logoColor=white" alt="Book a consultation" /></a>
323
- </p>
324
-
325
- <p align="center">
326
- <a href="https://next8n.com"><strong>next8n.com</strong></a> &nbsp;|&nbsp; <a href="https://services.next8n.com"><strong>Schedule a call</strong></a>
327
- </p>
328
-
329
- ---
330
-
331
- ## Enterprise Features
332
-
333
- ### 7 Redaction Modes
334
79
  | Mode | Output | Reversible | Best for |
335
- |------|--------|------------|----------|
336
- | **Token** | `[EMAIL_0]` | Yes | LLM workflows |
337
- | **Mask** | `j***@e***.com` | No | Logs, dashboards |
338
- | **Hash** | `[EMAIL:a3f2b8c91d4e]` | No | Analytics |
339
- | **Redact** | `[REDACTED]` | No | Maximum privacy |
340
- | **Pseudonymize** | `sarah.miller@example.com` | Yes | GDPR pseudonymization, demo data, QA |
341
- | **Blackout** | `████████` | No | Visual censoring, like a black marker |
342
- | **Remove** | *(empty string)* | No | Complete deletion, no trace left |
343
-
344
- ### Confidence Scoring and Threshold
345
- Every detection gets a confidence score (0.0 to 1.0). Set a threshold to only redact high-confidence matches. Checksum-validated patterns (credit cards, IBANs) score 0.95. Broad patterns score lower. Reduces false positives by up to 50%.
346
-
347
- ### Allow and Deny Lists
348
- - **Allow List**: Values to NEVER redact (company email domains, public phone numbers)
349
- - **Deny List**: Values to ALWAYS redact (project codenames, internal secrets)
350
-
351
- ### Prompt Injection Detection
352
- Scans input data for 25+ prompt injection patterns before it reaches an LLM. Detects instruction overrides, jailbreaks, delimiter escapes, encoded payloads, and zero-width character injection. Returns BLOCK/FLAG/CLEAN with a composite threat score.
353
-
354
- ### Data Classification
355
- Assigns sensitivity labels (PUBLIC / INTERNAL / CONFIDENTIAL / RESTRICTED) based on what PII categories are found. Escalation rules: 10+ CONFIDENTIAL hits escalate to RESTRICTED. Maps directly to enterprise data governance policies.
356
-
357
- ### Vault Encryption (AES-256-GCM)
358
- Encrypt vault files at rest with a passphrase. Each tenant uses a different passphrase for complete isolation. Even with filesystem access, encrypted files are unreadable without the key. scrypt key derivation resists brute-force attacks.
359
-
360
- ### Persistent Audit Log
361
- JSONL audit log of all redaction activity. Compatible with Splunk, ELK, Datadog. Daily rotation + 100MB size limit. Compliant with GDPR Art.30, HIPAA (6-year), SOX (7-year), PCI DSS (1-year) retention requirements.
80
+ |---|---|---|---|
81
+ | Token | `[EMAIL_0]` | Yes | LLM workflows, the default |
82
+ | Pseudonymize | `sarah.miller@example.com` | Yes | Demo data, QA, GDPR pseudonymization |
83
+ | Mask | `j***@e***.com` | No | Logs and support tickets |
84
+ | Hash | `[EMAIL:a3f2b8c91d4e]` | No | Analytics and deduplication |
85
+ | Redact | `[REDACTED]` | No | Maximum privacy |
86
+ | Blackout | `████████` | No | Visual censoring |
87
+ | Remove | empty string | No | Leaving no trace |
88
+
89
+ ## What it detects
90
+
91
+ 216 patterns across 11 categories.
92
+
93
+ | Category | Examples |
94
+ |---|---|
95
+ | Contact | Email, international and UK phone numbers, titled person names |
96
+ | Financial | Credit cards (Luhn), IBAN (ISO 13616), BIC, EU VAT numbers, UK bank accounts |
97
+ | Government IDs | 25+ countries, including US SSN, UK NINO and NHS, German Steuer-ID and Personalausweis, Spanish DNI and NIE, Dutch BSN, Polish PESEL, Indian Aadhaar and PAN, Brazilian CPF |
98
+ | Network | IPv4, IPv6, MAC addresses, URLs, Bitcoin and Ethereum addresses |
99
+ | Location and dates | US ZIP, UK postcodes, GPS coordinates, dates and dates of birth |
100
+ | Medical | Medical record numbers |
101
+ | Infrastructure | Internal hostnames, UNC paths, LDAP names, connection strings, cloud API keys, JWTs, PEM keys, Slack webhooks |
102
+ | Vehicle | VIN, German, UK and French plates |
103
+ | Digital identity | UUIDs, social handles, IMEI, ICCID |
104
+ | Custom | Your own regex patterns, for example `ORD-\d{6}` |
105
+
106
+ ## Features in detail
107
+
108
+ | Feature | Detail |
109
+ |---|---|
110
+ | Deduplication | The same value gets the same token everywhere, so the model keeps relationships between fields |
111
+ | Field targeting | Allowlist or denylist paths such as `user.email`, `*.phone` or `metadata.*` |
112
+ | Vault | In memory, or file based in `~/.n8n/pii-vault/` so it survives restarts. Sessions expire after 60 minutes by default |
113
+ | Vault encryption | AES-256-GCM with scrypt key derivation, one passphrase per tenant |
114
+ | Confidence threshold | Each match carries a 0.0 to 1.0 score. Checksum validated patterns score 0.95 |
115
+ | Allow and deny lists | Values to never redact, such as your support address, and values to always redact, such as project codenames |
116
+ | Prompt injection check | 25+ patterns, including instruction overrides, delimiter escapes, encoded payloads and zero width characters. Returns BLOCK, FLAG or CLEAN |
117
+ | Audit report | A second output with hits by category and pattern |
118
+ | Audit log | JSONL with daily rotation and a 100 MB cap, readable by Splunk, ELK and Datadog |
119
+ | ROPA record | Turn on Include Audit Report, then Include GDPR Art.30 ROPA Record, and fill in the controller details |
120
+ | Presidio | Optional Microsoft Presidio container for names and organisations in free text. See [docs/PRESIDIO_SETUP.md](https://github.com/mjmirza/n8n-nodes-redactor/blob/master/docs/PRESIDIO_SETUP.md). Falls back to built-in patterns when unreachable |
121
+ | Per-tenant profiles | Planned for 2.0.0 as JSON settings in the node |
122
+
123
+ This node reduces what reaches a model. It is not legal advice and does not on its own make a workflow GDPR or HIPAA compliant.
124
+
125
+ ## For developers
126
+
127
+ | Area | Detail |
128
+ |---|---|
129
+ | Language | TypeScript, strict mode |
130
+ | Runtime dependencies | None. Only `n8n-workflow` as a peer |
131
+ | Tests | Jest, run on every push in CI |
132
+ | Node.js | 24, as pinned in `.nvmrc` and CI. Node 26 has no prebuilt `isolated-vm`, which `n8n-workflow` loads in tests |
362
133
 
363
- ### GDPR Art.30 ROPA Report
364
- Generates structured compliance reports covering all 8 fields required by GDPR Article 30(1): controller, purposes, data subjects, personal data categories, recipients, third-country transfers, retention, and security measures. Auto-populated from redaction results.
365
-
366
- ### Per-Tenant Profiles
367
- Save and load redaction configurations per client/tenant. Each profile defines: enabled patterns, allow/deny lists, confidence threshold, redaction mode, and compliance settings. Agencies managing multiple clients can switch profiles per workflow.
368
-
369
- ---
370
-
371
- ## Enhanced NLP Detection (Optional Presidio Integration)
372
-
373
- For users who need NLP-level accuracy in detecting person names, locations, and organizations in free text, the node optionally integrates with Microsoft Presidio (open source, MIT license).
374
-
375
- **What it adds:** Catches "Sarah Johnson" and "Goldman Sachs" in free text paragraphs that regex alone cannot detect.
376
-
377
- **Setup (one command):**
378
134
  ```bash
379
- docker run -d -p 5002:3000 mcr.microsoft.com/presidio-analyzer
135
+ npm ci
136
+ npm run typecheck
137
+ npm run lint
138
+ npm test
139
+ npm run build
380
140
  ```
381
141
 
382
- **In the node:** Toggle "Enhanced NLP Detection" to ON, enter `http://localhost:5002`. Done.
383
-
384
- **No Presidio? No problem.** The node works perfectly without it. Presidio is an optional upgrade for maximum accuracy. If the container is unreachable, the node falls back silently to regex-only detection.
385
-
386
- For docker-compose setup and language configuration, see [docs/PRESIDIO_SETUP.md](https://github.com/mjmirza/n8n-nodes-redactor/blob/master/docs/PRESIDIO_SETUP.md).
387
-
388
- ---
389
-
390
- ## Missing a use case? We'll build it for you.
142
+ Project layout:
143
+ - `nodes/Redactor/` holds the node, the detection engine, patterns, vault and reports
144
+ - `test/` holds the Jest suites
145
+ - `tools/check-tarball.sh` makes sure only the built node ships to npm
146
+ - `.github/workflows/` holds CI and the signed publish workflow
391
147
 
392
- This node covers 210+ data types across 22 privacy regulations. But every business has unique data: internal codes, proprietary identifiers, industry-specific formats.
148
+ Releases are cut by pushing a `vX.Y.Z` tag. The publish workflow tests, builds and publishes with npm provenance.
393
149
 
394
- **You can add your own patterns directly in the node UI** using the Custom Patterns section. Define any regex, give it a label, and the engine will detect and redact it alongside the built-in patterns.
150
+ ## Support
395
151
 
396
- If there is a specific use case that is not covered here and you want us to cover it so that everyone can benefit from it, or if you want a customized implementation built on top of this node, **reach out to us and we will be happy to enhance it accordingly.**
397
-
398
- <p align="center">
399
- <a href="https://services.next8n.com"><img src="https://img.shields.io/badge/Request_a_Custom_Pattern_or_Feature-services.next8n.com-7B61FF?style=for-the-badge&logoColor=white" alt="Request a feature" /></a>
400
- </p>
401
-
402
- ---
403
-
404
- ## Also by next8n
405
-
406
- <p align="center">
407
- <a href="https://www.npmjs.com/package/n8n-nodes-xentral"><img src="https://img.shields.io/badge/n8n--nodes--xentral-30_Resources_|_163_Operations_|_58_Webhooks-00C4B4?style=for-the-badge" alt="n8n-nodes-xentral" /></a>
408
- </p>
409
-
410
- **[n8n-nodes-xentral](https://www.npmjs.com/package/n8n-nodes-xentral)** - The most comprehensive n8n community node for Xentral ERP. 30 resources, 163 operations, 58 webhook events. Full API audit verified. If you're automating Xentral workflows, this is the node you need.
411
-
412
- ---
152
+ - Custom patterns, new use cases or setup help go to [services.next8n.com](https://services.next8n.com)
153
+ - Bugs and feature requests go to [GitHub issues](https://github.com/mjmirza/n8n-nodes-redactor/issues)
154
+ - Also by next8n, [n8n-nodes-xentral](https://www.npmjs.com/package/n8n-nodes-xentral) for Xentral ERP
413
155
 
414
156
  ## License
415
157
 
416
- **Fair Use Code License (FUCL)**
417
-
418
- Copyright (c) 2026 Mirza Iqbal / [next8n](https://next8n.com). All rights reserved.
419
-
420
- This node is published as an n8n community node for the benefit of the n8n ecosystem and the teams building AI workflows that need to handle customer data responsibly. However, the intellectual property, source code, and all associated rights are owned exclusively by the copyright holder.
421
-
422
- **Permitted:**
423
- - Install and use this node for your own internal workflows and business automation
424
-
425
- **Prohibited without explicit written consent:**
426
- - Copying, forking, or reproducing the source code in any form
427
- - Commercial redistribution, resale, sublicensing, or white-labeling
428
- - Creating derivative works or competing products based on this code
429
- - Public redistribution of modified or unmodified versions
430
- - Using the Software as part of a commercial service offering
431
- - Removing or altering copyright notices or attribution
432
-
433
- **Attribution:** This node was developed and is actively maintained by [next8n](https://next8n.com). Attribution must be preserved in all copies.
434
-
435
- This software is provided "as is", without warranty of any kind, express or implied.
436
-
437
- **We built it. We maintain it. We own the rights to the code.**
438
-
439
- **Legal notice:** This is an original, independently authored work. The entire source code is the intellectual property of the copyright holder. No third-party proprietary code is included. All PII detection runs locally using pattern matching and validation algorithms authored by next8n.
440
-
441
- Interested in collaborating or contributing? We're open to partnerships. Let's talk.
442
-
443
- For commercial licensing, partnership, or custom development: [services.next8n.com](https://services.next8n.com)
158
+ MIT. See [LICENSE](LICENSE). Copyright (c) 2026 Mirza Iqbal, [next8n](https://next8n.com).
@@ -1,5 +1,5 @@
1
1
  import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class PiiRedactor implements INodeType {
2
+ export declare class Redactor implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
5
  }