Sensitive Info Protection
by @leefj0606
Sensitive information real-time protection skill that automatically detects, alerts, and handles sensitive data in user interactions. Supports custom detecti...
clawhub install sensitive-info-protection๐ About This Skill
name: sensitive-info-protection description: "Sensitive information real-time protection skill that automatically detects, alerts, and handles sensitive data in user interactions. Supports custom detection rules, external data source integration, and interactive processing. Use when you need to: (1) Scan text content for sensitive information, (2) Configure custom sensitive data detection rules, (3) Protect against accidental exposure of credentials, personal info, or business secrets." metadata: openclaw: requires: bins: - python3
Sensitive Info Protection
Overview
A general-purpose sensitive information protection skill that provides real-time scanning, detection, and interactive handling of sensitive data in conversation content. It helps prevent accidental exposure of personal information, authentication credentials, and commercial secrets through configurable detection rules.
Core Capabilities
1. Sensitive Information Detection
2. Configuration Management
3. External Data Integration
4. Interactive Processing
Default Sensitive Types
Built-in detection for the following types:
api_key - API keys, access tokens, authentication credentialscredit_card - Credit card numbersid_card - National ID card numbers (Chinese)phone - Mobile phone numbers (Chinese)email - Email addressesbank_card - Bank card numberspassword - Password patterns in code or logssecret - Commercial secrets, confidential information markersUsage
Scanning Content for Sensitive Information
from scripts.detector import SensitiveDetectordetector = SensitiveDetector()
results = detector.scan(text_content)
if results:
# Print detection results in standard format
detector.print_results(results)
# Wait for user decision to proceed
else:
# No sensitive information detected
pass
Adding Custom Rule
from scripts.models import DetectionRulenew_rule = DetectionRule(
name="custom_secret",
pattern=r"MY_SECRET=\w+",
sensitivity="high",
description="Custom secret pattern"
)
detector.add_rule(new_rule)
Loading Configuration from File
detector.load_config("path/to/config.json")
Output Format
When sensitive information is detected, the following format is used:
## ๆฃๆต็ปๆ
ๆๆ็ฑปๅ: [type]
ไฝ็ฝฎ: [start:end]
ๅๆ: [original content]
ๆๆๅบฆ: [high/medium/low] ๆไฝ้้กน
1. ็กฎ่ฎคๆพ่ก
2. ไฟฎๆนๅๅ้
3. ๅๆถๅ้
Resources
scripts/
detector.py - Main detection engine classmodels.py - Data models for detection rules and resultscli.py - Command-line interfacedefault_rules.json - Built-in default detection rulesreferences/
configuration.md - Detailed configuration guideapi.md - API documentation for integrationassets/
default_config.json - Default configuration template๐ก Examples
Scanning Content for Sensitive Information
from scripts.detector import SensitiveDetectordetector = SensitiveDetector()
results = detector.scan(text_content)
if results:
# Print detection results in standard format
detector.print_results(results)
# Wait for user decision to proceed
else:
# No sensitive information detected
pass
Adding Custom Rule
from scripts.models import DetectionRulenew_rule = DetectionRule(
name="custom_secret",
pattern=r"MY_SECRET=\w+",
sensitivity="high",
description="Custom secret pattern"
)
detector.add_rule(new_rule)
Loading Configuration from File
detector.load_config("path/to/config.json")