Privacy Shield
by @xiaobu2020
Manages sensitive data access by marking resources with privacy levels and enforcing share, export, and usage restrictions based on a centralized registry.
clawhub install privacy-shieldπ About This Skill
Privacy Shield
Privacy data marking system β unified sensitive resource management with pre-operation checks and audit logging.
Design Principles
Privacy Levels
| Level | Meaning | Example |
|-------|---------|---------|
| owner_only | Owner can view/use only | Photos, personal info |
| private | No external disclosure, internal use OK | Model info, API keys |
| no_export | Must not leave the machine | Memory files, ontology |
| public | Free to use | Non-sensitive data |
Quick Start
Mark a resource
# Mark a file or directory
python scripts/registry.py mark media/images/people/ --level owner_only --reason "Family photos"Mark a rule category
python scripts/registry.py mark --type rule "model_info" --level private --reason "Infrastructure"
Check permission
# Check if a resource can be shared
python scripts/registry.py check media/images/people/photo.jpg --action shareCheck privacy level only
python scripts/registry.py check media/images/people/photo.jpg
List all marks
python scripts/registry.py list
python scripts/registry.py list --level owner_only
Remove a mark
python scripts/registry.py unmark media/images/old-photo.jpg
View audit log
python scripts/registry.py audit
python scripts/registry.py audit --deny-only
Agent Integration
Before any data output operation:
1. Check registry β python scripts/registry.py check
2. Evaluate result:
- owner_only β Output only when owner requests
- private β No external disclosure, internal processing OK
- no_export β Never leave this machine
- Unmarked β Default to caution, ask the owner
Registry File
Location: data/privacy-registry.json
{
"version": "1.0.0",
"rules": {
"photos": {"level": "owner_only", "reason": "Family photos"},
"model_info": {"level": "private", "reason": "Infrastructure"}
},
"resources": [
{
"path": "media/images/people/",
"level": "owner_only",
"reason": "Family photos",
"marked_at": "2026-03-20T09:53:00+08:00"
}
]
}
Features
--privacy flag)π‘ Examples
Mark a resource
# Mark a file or directory
python scripts/registry.py mark media/images/people/ --level owner_only --reason "Family photos"Mark a rule category
python scripts/registry.py mark --type rule "model_info" --level private --reason "Infrastructure"
Check permission
# Check if a resource can be shared
python scripts/registry.py check media/images/people/photo.jpg --action shareCheck privacy level only
python scripts/registry.py check media/images/people/photo.jpg
List all marks
python scripts/registry.py list
python scripts/registry.py list --level owner_only
Remove a mark
python scripts/registry.py unmark media/images/old-photo.jpg
View audit log
python scripts/registry.py audit
python scripts/registry.py audit --deny-only