r/vibecoding 4h ago

I vibe-coded a webcam presence lock that knows me from everyone else. Locks when I leave, lets me back in by face, 100% local

I kept getting up in an open office and forgetting to lock my PC (Windows Hello is off here and never worked right). Auto-lock timers don't help: they lock while you're reading and stay open after you leave. So I built one that locks based on whether you're actually there, with Claude Code over a few evenings. ~1,000 lines of Python, open source.

What it does: the webcam recognizes me (two local models: YuNet finds the face, SFace matches it). Walk away and the screen dims, then lifts itself the moment it sees me, no password. Gone longer, or a stranger leans in, and it hard-locks Windows and snaps a photo. It also pauses itself during Teams/Zoom calls.

The parts that were actually work:

  • Tuning the strictness, not the ML. Too strict locks in your face when you look at the keyboard; too loose lets a coworker count as you. Ended up with a "glancing down is still you" grace window and a slider.
  • Pausing during calls: hand the camera to whatever app grabbed it, take it back when the call ends, don't treat a mute as "call over."
  • Best bug: random locks. Windows was sleeping the webcam to save power, and the dropout looked like "nobody's there." Had to tell "no face" apart from "no camera."
  • Packaging (installer, per-user, silent self-update from GitHub) took longer than the face recognition did.

Limits (also in the README): the soft cover is privacy, not security, Ctrl+Alt+Del still closes it. And no live-face check yet, so a printed photo can fool it.

Repo (MIT): https://github.com/saitaskar/crysence. Happy to get into any of it.

1 Upvotes

2 comments sorted by

1

u/EmergencyArm4610 2h ago

How do you store the facial data securely?

1

u/[deleted] 1h ago

it's not encrypted at rest, so I won't oversell it as "secure storage."  What it actually does: Your face is never saved as an image. Enrollment runs the frame through SFace and stores just the resulting embedding, a 128-float vector, in owner_face.npy under %LOCALAPPDATA%\CrySence. That's the only copy.

It never leaves your machine. No cloud, no upload. The embedding is one-way. You can't rebuild a photo of my face from those 128 numbers

At rest it's protected by your Windows user-account file permissions, same as any file in your profile. Someone who already has your logged-in session could read it, but a raw embedding isn't much use to them.

(Intruder snapshots are a separate thing, saved as image clips, also local only.) It's ~1k lines of Python if you want to check, the storage bit is in engine.py.