Privacy data marking system — unified sensitive resource management with pre-operation checks and audit logging.
LevelMeaningExampleowner_onlyOwner can view/use onlyPhotos, personal infoprivateNo external disclosure, internal use OKModel info, API keysno_exportMust not leave the machineMemory files, ontologypublicFree to useNon-sensitive data
bash
# 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"
bash
# Check if a resource can be shared
python scripts/registry.py check media/images/people/photo.jpg --action share
# Check privacy level only
python scripts/registry.py check media/images/people/photo.jpg
bash
python scripts/registry.py list
python scripts/registry.py list --level owner_only
bash
python scripts/registry.py unmark media/images/old-photo.jpg
bash
python scripts/registry.py audit
python scripts/registry.py audit --deny-only
Before any data output operation:
Check registry → python scripts/registry.py check <resource> --action <action>
Evaluate result:
owner_only → Output only when owner requestsprivate → No external disclosure, internal processing OKno_export → Never leave this machineLocation: data/privacy-registry.json
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"
}
]
}
--privacy flag)