Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patricio0312rev/skills --skill pii-redaction-logging-policy-builder -a claude-code
Open on GitHub

What 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 redactPII wrapper 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-code

2Manually: put the files in place

~/.claude/skills/pii-redaction-logging-policy-builder/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pii-redaction-logging-policy-builder/

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

Similar skills

All skills for Security →

From the same set148

The whole set →
background-jobs-designer The background-jobs-designer skill designs queued background work with retries, idempotency, and monitoring. Use it when building BullMQ, Celery, or worker-based processing. CX Codex +1 286installs adr-writer The adr-writer skill turns technical choices into Architecture Decision Records with context, options, tradeoffs, consequences, and owners. Use it when a decision needs a lasting record. CX Codex +1 286installs quality-gates-enforcer quality-gates-enforcer enforces strict CI thresholds for test coverage, ESLint zero-warning rules, type safety, vulnerability audits, and bundle budgets. CX Codex +1 284installs system-design-generator system-design-generator turns product or feature requirements into architecture plans with components, data flows, API contracts, and scaling notes. Useful before implementation starts. CX Codex +1 284installs flaky-test-detective The flaky-test-detective skill traces intermittent test failures to timing, state, random data, or network calls. Use it when a test passes and fails across runs. CX Codex +1 283installs monorepo-setup monorepo-setup lays out a Turborepo and pnpm monorepo: apps, shared packages, TypeScript and ESLint configs, and a build pipeline. CX Codex +1 283installs typescript-strict-migrator typescript-strict-migrator moves a TypeScript codebase to strict mode one compiler flag at a time: audit the errors, then turn on noImplicitAny, strictNullChecks and the rest. Handy when strict: true throws too much at once. CX Codex +1 280installs migration-planner migration-planner turns a database or platform move into ordered phases with feature flags, dual writes, backfill and checks, plus a way back from each step. CX Codex +1 279installs

Project sponsors

Companies that keep this analytics open