@patricio0312rev/pii-redaction-logging-policy-builder

Comprehensive library of +100 production-ready development skills covering every aspect of modern software engineering. From project setup to production deployment, from security hardening to performance optimization.

View in AI SkillSafe app
Scanned · no findings
0 downloads
0 stars
0 demos
SKILL.md
namepii-redaction-logging-policy-builder
descriptionPrevents 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

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

# 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

Embed badges

Add these to your README to show the skill's verification status.

SkillSafe verified badge
Verified badge
[![SkillSafe verified badge](https://api.skillsafe.ai/v1/badge/@patricio0312rev/pii-redaction-logging-policy-builder/verified)](https://skillsafe.ai/skill/@patricio0312rev/pii-redaction-logging-policy-builder/)
Installs badge
Installs badge
[![Installs badge](https://api.skillsafe.ai/v1/badge/@patricio0312rev/pii-redaction-logging-policy-builder/installs)](https://skillsafe.ai/skill/@patricio0312rev/pii-redaction-logging-policy-builder/)
Scan badge
Scan badge
[![Scan badge](https://api.skillsafe.ai/v1/badge/@patricio0312rev/pii-redaction-logging-policy-builder/scan)](https://skillsafe.ai/skill/@patricio0312rev/pii-redaction-logging-policy-builder/)
Eval pass rate badge
Eval pass rate
[![Eval pass rate badge](https://api.skillsafe.ai/v1/badge/@patricio0312rev/pii-redaction-logging-policy-builder/eval)](https://skillsafe.ai/skill/@patricio0312rev/pii-redaction-logging-policy-builder/)