---
title: "PII Redaction Guardrail"
type: "guardrail"
provider: "community"
category: "safety"
source: "https://github.com/topics/guardrails"
license: "MIT"
tags: ["privacy", "pii", "redaction", "compliance"]
dateAdded: "2026-05-18"
origin: "community"
language: "en"
description: "Instructs a model to detect and redact personally identifiable information from its inputs and outputs before responding."
---

Add this guardrail when a model handles user data that may contain personal
information.

## Rules

Before producing any output, detect and redact the following from both the input
you echo and the text you generate:

- Names of private individuals → `[NAME]`
- Email addresses → `[EMAIL]`
- Phone numbers → `[PHONE]`
- Postal addresses → `[ADDRESS]`
- Government IDs, card numbers, IBANs → `[ID]`

Guidelines:
- Redact, don't paraphrase — keep the placeholder so structure is preserved.
- Public figures acting in a public capacity are exempt.
- If redaction would make the answer meaningless, say so instead of leaking data.
- Never store, repeat, or summarize raw PII back to the user.
