The problem
A child-safety system needs to understand activity across multiple input types without making continuous cloud uploads the default. It also has to respond quickly enough to work alongside everyday applications.
I built an offline macOS safety engine spanning vision, OCR, typed text, and speech, with a separate family-management and live-monitoring path.
Local intelligence first
ScreenCaptureKit supplies screen capture on macOS. Core ML supports local inference; the surrounding Swift and Python components coordinate detection across input types. Electron provides the desktop application layer.
Trust and access
- 01Device inputsScreenCaptureKit, OCR, typed text, and speech
- 02Local classificationOffline Core ML safety engine
Family-scoped PostgreSQL RLS and hashed device tokens control access. The live video path is separate from classification escalation.
The backend uses hashed device tokens and family-scoped PostgreSQL row-level security. Classification escalation to Claude uses privacy-preserving uploads; access control is enforced at the database boundary.
A separate live-monitoring path
I rebuilt screen monitoring around peer-to-peer WebRTC, Electron, and Cloudflare TURN. The implementation improved observed throughput from approximately 0.5 to 4 FPS. TURN can relay encrypted media when direct connectivity fails; the application backend does not store the video stream.
Results
- Inference latency reduced from 14 ms to 3.1 ms per check.
- Vision, OCR, text, and speech supported in an offline macOS engine.
- Live-screen throughput improved to approximately 4 FPS in the project setup.
- Family-scoped access and privacy-preserving escalation implemented.
Engineering takeaway
Fast local decisions and remote visibility have different constraints. Keeping those paths separate makes it possible to optimize responsiveness without turning every inference into a network request.