PII/PHI scrubbing for captured demonstrations.
Repository: OpenAdaptAI/openadapt-privacy
pip install openadapt[privacy]
# or
pip install openadapt-privacy
The privacy package provides:
openadapt privacy scrub my-task
Options:
--output - Output directory (default: scrubbed/)--mode - Redaction mode (blur, mask, replace)--types - Information types to scrub (default: all)openadapt privacy detect my-task
Shows detected PII/PHI without modifying files.
openadapt privacy scrub-image screenshot.png --output clean.png
from openadapt_privacy import Scrubber, PIIDetector
# Create a scrubber
scrubber = Scrubber(mode="blur")
# Scrub a demonstration
scrubber.scrub_demonstration("my-task", output_dir="scrubbed/")
# Or scrub individual images
scrubbed_image = scrubber.scrub_image(screenshot_path)
# Just detect without scrubbing
detector = PIIDetector()
detections = detector.detect(screenshot_path)
for detection in detections:
print(f"{detection.type}: {detection.text} at {detection.bbox}")
from openadapt_capture import CaptureSession, Recorder
from openadapt_privacy import Scrubber
# Record with automatic scrubbing
session = CaptureSession(
name="my-task",
scrubber=Scrubber(mode="blur")
)
recorder = Recorder(session)
recorder.start()
# ... demonstration collection ...
recorder.stop()
# Demonstrations are automatically scrubbed
| Mode | Description | Use Case |
|---|---|---|
blur |
Gaussian blur over sensitive areas | Visual redaction |
mask |
Black box over sensitive areas | Complete hiding |
replace |
Replace with placeholder text | Maintaining layout |
| Export | Description |
|---|---|
Scrubber |
Main scrubbing class |
PIIDetector |
PII detection |
PHIDetector |
PHI detection |
Detection |
Detection result |
RedactionMode |
Redaction options |
| Model | Types | Accuracy |
|---|---|---|
presidio |
PII | High |
philter |
PHI | High |
regex |
Common patterns | Medium |
custom |
User-defined | - |
This package helps with compliance for:
!!! warning “Disclaimer” This tool assists with privacy protection but does not guarantee compliance. Always consult with legal and compliance experts for your specific use case.