# Security

> Scan and redact PII and sensitive data (emails, phone numbers, SSNs, API keys, IP addresses, credentials, amounts, company/person names) from repository files. Includes a pre-commit hook to block commits containing PII. Use when asked to audit code for sensitive data, sanitize files before publishing, or install PII detection hooks. For application security hardening see security-engineering.

- Skill: `lazyisefficient/security` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add lazyisefficient/security`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lazyisefficient/security/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: LazyIsEfficient (https://skillmd.com/u/lazyisefficient)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lazyisefficient/security

---


# Security Sanitizer

Scans and redacts PII / sensitive data from files in this repo. Uses only Python standard library — no external dependencies.

## Tools

Resolve scripts project-first, then global install ([findings-ledger references/install-paths.md](../findings-ledger/references/install-paths.md) — same pattern, swap skill name):

```sh
PROJ="${CLAUDE_PROJECT_DIR:-.}"
SAN="$PROJ/.claude/skills/security/scripts/sanitizer.py"
[ -f "$SAN" ] || SAN="$PROJ/.agents/skills/security/scripts/sanitizer.py"
[ -f "$SAN" ] || SAN="$HOME/.claude/skills/security/scripts/sanitizer.py"
[ -f "$SAN" ] || SAN="$HOME/.agents/skills/security/scripts/sanitizer.py"
```

| Script | Purpose | Key Command |
|--------|---------|-------------|
| `scripts/sanitizer.py` | Scan or redact PII in files | `python3 "$SAN" --scan --dir . --recursive` |
| `scripts/pre-commit-hook.sh` | Git hook to block commits with PII | Copy it from the resolved skill directory to `.git/hooks/pre-commit`, then `chmod +x` it |

## Configuration

Edit `scripts/sanitizer-config.json` beside this skill (same directory as `$SAN`) to customize blocklists, custom regex patterns, skip paths, and placeholder format.

## Exit Codes

`0` = clean, `1` = PII found (useful for CI).

## Related skills

- [security-engineering](../security-engineering/SKILL.md) — application security, OWASP, auth hardening, input validation, auth/session patterns for web applications

