agentleFS
profbernardojprofbernardoj/everclaw/skills/pii-guard/SKILL.md

pii-guard

Skill112 starsChanged 3 months agoMITView on GitHub

Personally identifiable information (PII) leak prevention for EverClaw. Scans outbound content against configurable PII patterns before git push, email, social media, ClawHub publishing, GitHub interactions, or any external data transmission. Provides git pre-push hooks, CLI scanning tools, and hard-block enforcement with user override capability. Use when checking content for PII before external actions, adding new protected patterns, configuring git pre-push hooks, or auditing data leak prevention.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All protected patterns live in the workspace:

    line 25
  2. Distinctive:

    When PII is detected:

    line 43
  3. Distinctive:

    When in doubt, scan first

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PII Guard — Personal Data Leak Prevention

Purpose

Prevents personal identifiable information (PII) from being sent to external services. This skill MUST be checked before any outbound action that transmits data externally.

When This Fires

Mandatory check before:

  • git push (any repo)
  • Sending emails
  • Posting to social media (X/Twitter, Moltbook, etc.)
  • Publishing to ClawHub
  • Creating/updating GitHub issues, PRs, discussions, or comments
  • Any message action to external channels with file attachments
  • Any web_fetch POST or form submission
  • Any exec command that sends data externally (curl POST, scp, rsync, etc.)

How It Works

1. Pattern File

All protected patterns live in the workspace:

~/.openclaw/workspace/.pii-patterns.json

This file is NEVER committed — it contains the very data it protects.

2. Scanning

The scanner checks content against all patterns in these categories:

  • names — Protected personal names
  • emails — Protected email addresses
  • phones — Protected phone numbers (all formats)
  • wallets — Protected blockchain addresses
  • organizations — Protected org/church/school names
  • people — Protected associate/contact names
  • websites — Protected personal domains
  • keywords — Any other protected strings

3. Behavior: HARD BLOCK

When PII is detected:

  1. STOP — Do not proceed with the external action
  2. REPORT — Tell the user exactly what was found and where
  3. WAIT — Only proceed if the user explicitly confirms after reviewing

Error format:

🚫 PII GUARD: Blocked — personal data detected

Found in: <filename or content description>
Match: "<the matched pattern>"
Category: <names|emails|phones|etc>

Action blocked: <what was about to happen>
To proceed: Remove the PII or explicitly confirm override.

4. Git Pre-Push Hook

A global git hook is installed at:

~/.openclaw/workspace/scripts/git-hooks/pre-push

Configured via: git config --global core.hooksPath ~/.openclaw/workspace/scripts/git-hooks

This runs automatically on every git push across ALL repos on this machine.

  • Scans the diff being pushed (not just HEAD)
  • Blocks push if PII detected
  • Can be bypassed with git push --no-verify (use with extreme caution)

5. Agent Integration

The agent should call pii_scan before external actions:

# Scan a file
~/.openclaw/workspace/scripts/pii-scan.sh <file_or_directory>

# Scan stdin
echo "some content" | ~/.openclaw/workspace/scripts/pii-scan.sh -

# Scan a string
~/.openclaw/workspace/scripts/pii-scan.sh --text "check this string"

Exit codes:

  • 0 — Clean, no PII found
  • 1 — PII detected (blocked)
  • 2 — Error (patterns file missing, etc.)

Adding New Patterns

Edit ~/.openclaw/workspace/.pii-patterns.json and add entries to the appropriate category array. Changes take effect immediately — no restart needed.

Security Notes

  • .pii-patterns.json must NEVER be committed to any repo
  • The patterns file itself contains PII — treat it as sensitive
  • The hook and scan scripts are safe to publish (they contain no PII)
  • When in doubt, scan first

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.