rev 2026.06
stop showing
your email
on stream.
a live privacy preview for screen sharing. apple vision ocr finds the emails, phone numbers, and secrets on your display, then redacts them before they ever reach the stream.
apple vision finds an email, a phone number, and a custom string, then covers each before the frame is shown.
the exposure
the countermeasure
over-redact is safer than leak.
guard watches your screen, finds what looks like personal data, and covers it on a delayed preview before it ever reaches the stream. capture and detection are decoupled, so the preview never waits on ocr. if anything in the pipeline breaks, the client fails closed with a black frame.
the procedure
the main display streams to a pixel buffer continuously. capture never blocks on detection.
frames are downscaled and ocr runs five to ten times a second, off the hot path.
email regex and custom needles run against recognized text, producing per-substring boxes.
a thread-safe snapshot holds the latest boxes, so the preview never waits on detection.
the delayed frame is drawn with boxes or a blackout over anything that matched.
operating modes
accurate ocr, a longer delay buffer, and full blackouts while armed. for demos and recordings you cannot re-shoot.
fast ocr, a modest delay, and boxes by default. the one you reach for most days.
lower delay and a faster cadence. for live walkthroughs where the preview should track your hands.
deployment
the same machine captures the screen, runs ocr, and renders the protected preview. no network, no trust surface.
a client mac captures frames and sends them to a processing server over a token-authenticated websocket. if the remote path fails, the client fails closed with a black frame.
field install
macos only. built with swiftpm, no xcode project. the interactive installer builds the release binary and offers to start any mode.
- macOS 14 or newer
- SwiftPM from xcode or the command line tools
- Screen Recording permission for your terminal
./scripts/setup.sh swift build -c release
.build/release/pii-stream watch --mode standard pii-stream serve --host 0.0.0.0 --port 8765 \
--token "a-long-random-token"
pii-stream watch --remote SERVER:8765 \
--token "a-long-random-token" --mode standard pii-stream detect-image --image ./shot.png --json the safe default
when in doubt, show nothing.
if anything in the pipeline breaks, you do not get a partial frame with pii in it. you get a black frame. the safe default is no picture.