Presidio PII Protection
Use this skill when customer data may contain PII.
Use it for
Scrub data before reasoning when working with:
- customer notes
- CRM or lead data
- estimates
- project records
- emails or documents with names, phones, emails, addresses, account details, vessel names, or similar identifiers
Do not use it for
- internal ops data with no customer PII
- general system tasks
- product, SOP, or status discussions without customer-identifying details
Fail-closed rule
If Presidio is unhealthy, stop and tell the owner:
Cannot query or process customer data because Presidio PII protection is offline. Customer data will not be sent unprotected.
Workflow
1) Check health
bash SKILL_DIR/scripts/presidio-health.sh
Only continue if both services are healthy.
2) Scrub raw text
echo "RAW DATA HERE" | python3 SKILL_DIR/scripts/presidio-scrub.py SESSION_ID
Use any unique session ID.
Expected output shape:
{
"text": "[PERSON_1] at [LOCATION_1], phone [PHONE_NUMBER_1]",
"pii_found": 3,
"entity_types": ["PERSON", "LOCATION", "PHONE_NUMBER"],
"mapping_file": "/path/to/mapping.json",
"session_id": "SESSION_ID"
}
Reason only over the text field.
3) Restore before delivery
echo "MODEL RESPONSE WITH TOKENS" | python3 SKILL_DIR/scripts/presidio-restore.py SESSION_ID
That restores original values and deletes the mapping file by default.
What gets scrubbed
- names
- phone numbers
- email addresses
- physical addresses and cities
- credit card numbers
- SSNs
- bank details
- vessel names
- IP addresses
- Sea Cool-style project identifiers when matched by custom recognizers
Safe to pass through
- product names
- project statuses
- SOP terminology
- scope descriptions
- role names
- dollar amounts without customer-identifying context
Local files
Custom recognizers live in:
configs/recognizers.json
Scripts live in:
scripts/presidio-health.shscripts/presidio-scrub.pyscripts/presidio-restore.py
Keep this skill strict, minimal, and local-first.