Pii detector redactor

From FDU-INS/Insurance-Skills · View interactive version

Pii detector redactor is an AI agent skill from the GitHub repository FDU-INS/Insurance-Skills. Detects and redacts personally identifiable information from documents and agent outputs. Identifies names, addresses, email addresses, phone numbers, national insurance numbers, passport details, bank account numbers, and other PII categories with configurable redaction styles and audit logging for

How to use this skill

Skill file

PII Detector and Redactor

Purpose

Scans documents and agent-generated outputs to identify personally identifiable information across multiple PII categories, then applies configurable redaction to prevent unauthorised disclosure. The skill supports detection of both structured PII (such as national insurance numbers and email addresses following known formats) and unstructured PII (such as names embedded in free text or contextual identifiers that could re-identify individuals). All detection and redaction actions are logged to an audit trail to satisfy GDPR accountability requirements under Article 5(2).

When to Use

Instructions

  1. Receive the input document or text to be scanned. Identify the document type (free text, structured form, CSV, JSON) and select the appropriate parsing strategy for each format.
  2. Execute pattern-based detection across all standard PII categories: full names, dates of birth, postal addresses, email addresses, phone numbers (UK and international formats), national insurance numbers, passport numbers, driving licence numbers, bank account and sort code combinations, credit/debit card numbers, IP addresses, and vehicle registration numbers.
  3. Apply contextual analysis to detect PII that does not follow fixed patterns. This includes names that appear without surrounding identifiers, job titles combined with department names that could identify individuals in small organisations, and unique combinations of non-PII attributes that together constitute indirect identifiers.
  4. Classify each detected PII instance by category and assign a confidence score based on pattern strength and contextual signals. Flag items below the confidence threshold for human review rather than automatic redaction.
  5. Apply the configured redaction style to all confirmed PII instances. Supported styles are: full replacement with category label (e.g., [REDACTED-EMAIL]), partial masking retaining structure (e.g., j.s@****.com), consistent pseudonymisation using deterministic token mapping (e.g., replacing "Jane Smith" with "Person-A7" consistently throughout the document), or complete removal.
  6. Generate the redacted output document preserving all non-PII content, formatting, and document structure. Ensure that redaction markers do not break sentence grammar or data structure integrity.
  7. Produce an audit log entry recording: document identifier, timestamp, number of PII instances detected per category, redaction style applied, confidence scores, and any items flagged for human review.

Output Format

Quality Checks

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.