pii-redaction-logging-policy-builder — Claude Code skill
pii-redaction-logging-policy-builder sets up redaction rules and a logging policy to keep sensitive user data out of logs. Replaces emails, phone numbers, and payment cards with safe placeholders.
MIT 283 installs ★ 64 updated 2026-01-12
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a claude-codeWhat pii-redaction-logging-policy-builder does
The skill provides baseline patterns for scrubbing sensitive personal information before messages reach application log streams. It includes regex rules matching emails, social security numbers, phone numbers, and credit cards, swapping matches for tags like [REDACTED_EMAIL].
It establishes clear boundaries for log hygiene. The embedded policy specifies safe targets like request IDs, hashed user IDs, and HTTP response codes, while strictly forbidding raw passwords, full names, physical addresses, and API credentials.
Redaction patterns only work if your logging pipeline explicitly routes messages through the wrapper function.
What it helps with
- strip credit cards, phones, and emails from log strings
- establish a clean logging policy for data privacy compliance
- implement a TypeScript
redactPIIwrapper for safe log outputs - separate permitted telemetry fields from prohibited plain-text secrets
Example prompts for the agent
- Draft a safe logger wrapper to mask emails and phone numbers
- Help me set up a logging policy that complies with privacy rules
- Review our log messages and apply PII redaction patterns
How to install pii-redaction-logging-policy-builder
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a claude-code2Manually: put the files in place
~/.claude/skills/pii-redaction-logging-policy-builder/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pii-redaction-logging-policy-builder/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a codex2Manually: put the files in place
.agents/skills/pii-redaction-logging-policy-builder/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a cursor2Manually: put the files in place
.cursor/skills/pii-redaction-logging-policy-builder/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install patricio0312rev/skills security/pii-redaction-logging-policy-builder/SKILL.md2Manually: put the files in place
.github/skills/pii-redaction-logging-policy-builder/SKILL.md1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a gemini-cli2Platform CLI
gemini skills install https://github.com/patricio0312rev/skills --path security/pii-redaction-logging-policy-builderManually: put the files in place
.devin/skills/pii-redaction-logging-policy-builder/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about pii-redaction-logging-policy-builder
How do I install pii-redaction-logging-policy-builder in Claude Code?
Run npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a claude-code in your terminal.
What sensitive patterns are included out of the box?
The skill includes regular expressions targeting emails, SSNs, phone numbers, and credit card numbers.
Which application attributes are safe to record under the policy?
The policy permits recording request identifiers, hashed user IDs, HTTP status codes, response times, and error types.
Source text
SKILL.md · MIT
---
name: pii-redaction-logging-policy-builder
description: Prevents logging sensitive user data with redaction rules, logging policies, and safe log formatting. Use for "PII redaction", "log privacy", "GDPR logging", or "data privacy".
---
# PII Redaction & Logging Policy Builder
Protect user privacy in application logs.
## PII Redaction
```typescript
const PII_PATTERNS = {
email: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,
ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
phone: /\b\d{3}[-.]?\d{3}[-.]?\d{4}\b/g,
creditCard: /\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,
};
function redactPII(message: string): string {
let redacted = message;
Object.entries(PII_PATTERNS).forEach(([type, pattern]) => {
redacted = redacted.replace(pattern, `[REDACTED_${type.toUpperCase()}]`);
});
return redacted;
}
// Safe logging
logger.info(redactPII(\`User registered: \${email}\`));
// Output: "User registered: [REDACTED_EMAIL]"
```
## Logging Policy
```markdown
# Logging Policy
## ✅ DO Log
- Request IDs
- User IDs (hashed)
- HTTP status codes
- Response times
- Error types
- Feature flags
## ❌ DON'T Log
- Passwords
- Credit card numbers
- SSNs
- API keys
- Full emails (hash first)
- Full names
- Addresses
```
## Output Checklist
- [ ] Redaction rules defined
- [ ] Logging policy documented
- [ ] Safe logger wrapper
- [ ] Team trained
- [ ] Log monitoring
ENDFILE
© patricio0312rev · MIT · patricio0312rev/skills