Redact and restore PII in OpenAI prompts with Enterprise PII Guardrails
UnknownUnknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.
Community nodes
These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
n8n-nodes-piiguardrails(Mask PII with Enterprise Guardrails, Restore Original PII from Tokens)
Nodes used (4)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Pii Guardrails
n8n-nodes-piiguardrails.piiGuardrails - OpenAI
@n8n/n8n-nodes-langchain.openAi
What it does
Quick overview This workflow masks sensitive PII in a customer prompt using Enterprise PII Guardrails, sends the sanitized text through a simulated LLM step, and then restores the original values in the LLM response using the reversible token mapping. How it works 1. Starts manually to run a test prompt. 2. Creates a sample customer support prompt containing PII like a name, email address, phone number, medical record number, and credit card number. 3. Sends the prompt to Enterprise PII Guardrails to mask detected entities into surrogate tokens and returns a token-to-original mapping. 4. Generates a simulated LLM response that references the surrogate tokens rather than the original PII. 5. Sends the simulated response and the saved mapping back to Enterprise PII Guardrails to unmask tokens and restore the original PII in the final text. Setup 1. Self-host n8n and install the Enterprise PII Guardrails community node (n8n-nodes-piiguardrails). 2. Install and run Enterprise PII Guardrails locally (for example, pip install piiguardrails && piiguardrails start) and ensure the API is reachable (default http://localhost:8000). 3. Create and select an Enterprise PII Guardrails API credential in n8n that points to your Guardrails endpoint. 4. Replace the sample prompt and/or swap the simulated LLM step with your real LLM node, keeping the mask/unmask steps before and after the LLM call.