/mas-ai-workflows:ai-pii-redaction-reviewfrom mas-ai-workflows
Privacy-review AI payloads with field-aware redaction, typed stable placeholders, leakage scans across prompts/logs/tools/RAG, and residual-risk reporting before external submission. Use before sending data to cloud LLMs or sharing traces.
Ships in mas-ai-workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Redaction is a perimeter control: sensitive data should not reach the provider, the trace store, or the ticket dump in the clear. Regex alone is not anonymization. Pseudonymization with a retained key remains personal data for the controller under GDPR-style regimes—describe outputs as redacted/pseudonymized, never “guaranteed anonymous.”
Claude operates as a Principal Privacy Engineer for AI pipelines, specializing in destination/policy scoping, typed stable placeholders, reversal-map isolation, multi-surface leakage checks, and metadata-only audit logs.
┌─────────────────────────────────────────────────────────────┐
│ PII Redaction Review Stack │
│ Policy (allowed classes) → detect → minimize → placeholder │
│ → scan artifacts/meta/logs → restore only at auth boundary │
│ → report categories + residual risk (no raw secrets) │
└─────────────────────────────────────────────────────────────┘
Use when preparing prompts, RAG chunks, tool outputs, eval fixtures, or support packets for external LLMs or shared logs.
Do not use when unauthorized to view the sample; never ship originals to an external redaction SaaS without approval (prefer in-perimeter detection).
<<EMAIL_1>>) when relationships matter; keep reversal maps out of outgoing payloads and usually out of disk logs.| Surface | Action |
|---|---|
| Outbound LLM/tools | Redact before egress |
| RAG ingest | Redact/filter at index time or query time per policy |
| Agent hops | Re-check tool results before next model call |
| Observability | Prefer metadata + content hash; avoid raw prompt logs |
| Eval datasets | Redact before commit; @ai-evaluation-dataset |
"""Typed placeholder redaction with in-memory reversal map (never ship the map)."""
from __future__ import annotations
import re
from dataclasses import dataclass, field
EMAIL = re.compile(r"\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b", re.I)
@dataclass
class RedactionSession:
mapping: dict[str, str] = field(default_factory=dict) # placeholder -> original
inverse: dict[str, str] = field(default_factory=dict) # original -> placeholder
def redact_email(self, text: str) -> str:
def repl(m: re.Match[str]) -> str:
val = m.group(0)
if val not in self.inverse:
ph = f"<<EMAIL_{len(self.mapping)+1}>>"
self.inverse[val] = ph
self.mapping[ph] = val
return self.inverse[val]
return EMAIL.sub(repl, text)
def restore(self, text: str) -> str:
out = text
for ph, val in self.mapping.items():
out = out.replace(ph, val)
return out
Combine with NER for names/phones/addresses; treat credentials as block, not mask-and-send.
| Signature | Fix |
|---|---|
| PII in Langfuse/raw logs | Metadata-only audit; hash payload |
| Same person → different placeholders | Stable map per session |
| “Anonymous” claim | Downgrade language; document key custody |
| Leak via filename/PDF metadata | Strip meta; rename files |
| External redact API | Requires explicit approval—prefer local |
Redacted artifact + category-level change summary + residual risks + policy version. No removed values in the report.
@ai-evaluation-dataset, @ai-human-handoff-contract, @never-paste-private-passwords, @keep-sensitive-financials-private, @agent-injection-boundary-test
MANDATORY: Redact in-perimeter before egress. Use stable typed placeholders; isolate reversal maps. Scan all surfaces. Never claim perfect anonymity. Never include secrets in the review report.
LLM-Redactor / Presidio-style placeholder restoration; GDPR pseudonymisation guidance; industry practice on metadata-only AI audit logs; self-hosted redaction before provider egress.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin mas-ai-workflows2 plugins in one repository ship this exact skill · first indexed Oct 7, 2026
Other plugins' skills for the same job
10 skills in this plugin
/agent-injection-boundary-testTest authorized agents against indirect prompt injection in retrieved docs and tool outputs using paired clean/poison fixtures, synthetic canaries, and sandboxed tools. Evidence for these cases—not a claim injection is solved./agent-tool-replay-testReplay recorded agent tool/LLM trajectories against deterministic fixtures to test argument validation, errors, idempotency, and side-effect boundaries—separate from live tool-selection quality./ai-citation-verificationVerify AI citations across structural schema, resolvability (registry/URL/DOI), and semantic support of each claim by the cited span—not the whole context. Use for RAG answers, research agents, and regulated audit trails.