Locks your Mac when someone else looks at it. Offline face recognition, macOS menu-bar app + CLI.
See the code
Your Mac locks itself when someone else is looking at it.
Face recognition that runs on your Mac. Nothing gets uploaded.
You get up for coffee and leave your laptop open. Your friend sneaks over to mess with it. About a second later the screen locks, and if you turned on the intruder photo, their face is the lock screen wallpaper when you get back.
Just walking away doesn't lock anything. It only kicks in when someone who isn't you shows up, or when someone starts touching the Mac while nobody's in front of the camera.
brew tap c4rb0nx1/tap https://github.com/AmazingCarbon/homebrew-tap
brew install c4rb0nx1/tap/mog
mog install-app
Open Mog from ~/Applications, click Enroll My Face…, and hit Turn On before you walk away.
Homebrew builds it from source, which takes about a minute. It downloads the face model (110 MB) once and checks it against a pinned SHA-256. After that Mog doesn't go online, except when you check for updates.
On macOS 27 you need the Command Line Tools for Xcode 27, or Homebrew refuses to build. Get them from System Settings → General → Software Update.
On 0.3.0 or newer, click Check for Updates… in the menu bar, or run mog update.
On anything older, run this once. After that the menu button works.
brew update && brew upgrade c4rb0nx1/tap/mog && mog install-app
Then quit Mog and open it again. If brew says you're up to date but mog version shows an old number, your tap is stuck. Unstick it:
git -C "$(brew --repository c4rb0nx1/tap)" pull --ff-only
camera → find faces → line them up → ArcFace → 512 numbers → you / not sure / stranger → lock?
Sources/MogCore/Guard.swift:
You can't turn off the camera's green light; Apple wires it to the camera. So stealth mode just keeps the camera off until someone touches the Mac.
The catch: someone who only looks at the screen without touching anything won't get caught. Turning Mog off also needs a quick look, so the light blinks then. And don't use stealth mode with the lid closed, because the camera can't see you and every first touch will lock.
Everything's in the eye icon in your menu bar:
The first time you turn it on, macOS asks if Mog can use the camera.
Everything the app does, plus some debugging tools:
mog enroll # save your face (sit alone, look at the screen)
mog test # practice run: shows OWNER / STRANGER 0.xx for every frame, never locks
mog watch # the real thing; locks once, then quits
mog watch --photo # ...and puts the intruder's photo on the lock screen
mog watch --stealth # camera off until the Mac is touched, then one look
mog test --stealth # practice run of stealth mode, shows how long the check took
mog status # camera permission, lock, model, your profile
mog probe # 8 second camera check
mog lock-test # locks the screen in 3 s, to check locking works
mog intruders # list saved intruder photos
mog wallpaper-check # swaps in a test picture for 3 s, then puts your wallpaper back
mog update # check for a new version and upgrade with Homebrew
Options:
| Flag | Default | What it does |
|---|---|---|
--grace S | 1 | How many seconds a stranger has to be in view before it locks. |
--threshold X | 0.40 | Match score from which a face counts as you. |
--stranger X | 0.33 | Match score below which a face counts as a stranger. Lower means fewer false alarms, but a lookalike has an easier time. |
--no-input-lock | lock is on | Don't lock when someone touches the Mac with nobody in view. |
--stealth | off | Camera off until someone touches the Mac. --grace and --no-input-lock don't do anything here. |
In the terminal, camera permission belongs to whatever app you run mog in (Terminal, iTerm, Ghostty…).
~/.config/mog/profile.json, readable only by you. It's just numbers, 512 per sample, and they can't be turned back into a picture.~/.config/mog/intruders/, only the latest 20 are kept, and they never leave your Mac.mog update. That downloads one small file from GitHub, and nothing gets sent.Heads up: the intruder photo takes pictures of people without asking them. Depending on where you live, or your company's rules on a work laptop, that might not be okay. Check before you turn it on.
Mog is an extra layer, not real security.
SACLockScreenImmediate). Fine for a personal tool, but Apple wouldn't allow it in the App Store.Keep your password, FileVault and normal auto-lock turned on.
git clone https://github.com/AmazingCarbon/mog && cd mog
./Scripts/fetch-model.sh # downloads the 110 MB model, checks it, compiles it
swift build -c release # the CLI: .build/release/mog
./Scripts/build-app.sh # the app: .build/Mog.app, model included
swift run MogChecks # tests for the lock rules, matching, alignment and storage
| Folder | What's in it |
|---|---|
Sources/MogCore | The logic: lock rules, matching, alignment math, saving your profile. |
Sources/MogEngine | Camera, Vision, Core ML, locking, intruder photo, installer. Shared by the CLI and the app. |
Sources/mog | The command-line tool. |
Sources/MogBar | The menu bar app. |
Assets | The app icon. Rebuild it with ./Scripts/make-icons.sh. |
Swift
98.6%
Shell
1.4%
Locks your Mac when someone else looks at it. Offline face recognition, macOS menu-bar app + CLI.
See the code
Your Mac locks itself when someone else is looking at it.
Face recognition that runs on your Mac. Nothing gets uploaded.
You get up for coffee and leave your laptop open. Your friend sneaks over to mess with it. About a second later the screen locks, and if you turned on the intruder photo, their face is the lock screen wallpaper when you get back.
Just walking away doesn't lock anything. It only kicks in when someone who isn't you shows up, or when someone starts touching the Mac while nobody's in front of the camera.
brew tap c4rb0nx1/tap https://github.com/AmazingCarbon/homebrew-tap
brew install c4rb0nx1/tap/mog
mog install-app
Open Mog from ~/Applications, click Enroll My Face…, and hit Turn On before you walk away.
Homebrew builds it from source, which takes about a minute. It downloads the face model (110 MB) once and checks it against a pinned SHA-256. After that Mog doesn't go online, except when you check for updates.
On macOS 27 you need the Command Line Tools for Xcode 27, or Homebrew refuses to build. Get them from System Settings → General → Software Update.
On 0.3.0 or newer, click Check for Updates… in the menu bar, or run mog update.
On anything older, run this once. After that the menu button works.
brew update && brew upgrade c4rb0nx1/tap/mog && mog install-app
Then quit Mog and open it again. If brew says you're up to date but mog version shows an old number, your tap is stuck. Unstick it:
git -C "$(brew --repository c4rb0nx1/tap)" pull --ff-only
camera → find faces → line them up → ArcFace → 512 numbers → you / not sure / stranger → lock?
Sources/MogCore/Guard.swift:
You can't turn off the camera's green light; Apple wires it to the camera. So stealth mode just keeps the camera off until someone touches the Mac.
The catch: someone who only looks at the screen without touching anything won't get caught. Turning Mog off also needs a quick look, so the light blinks then. And don't use stealth mode with the lid closed, because the camera can't see you and every first touch will lock.
Everything's in the eye icon in your menu bar:
The first time you turn it on, macOS asks if Mog can use the camera.
Everything the app does, plus some debugging tools:
mog enroll # save your face (sit alone, look at the screen)
mog test # practice run: shows OWNER / STRANGER 0.xx for every frame, never locks
mog watch # the real thing; locks once, then quits
mog watch --photo # ...and puts the intruder's photo on the lock screen
mog watch --stealth # camera off until the Mac is touched, then one look
mog test --stealth # practice run of stealth mode, shows how long the check took
mog status # camera permission, lock, model, your profile
mog probe # 8 second camera check
mog lock-test # locks the screen in 3 s, to check locking works
mog intruders # list saved intruder photos
mog wallpaper-check # swaps in a test picture for 3 s, then puts your wallpaper back
mog update # check for a new version and upgrade with Homebrew
Options:
| Flag | Default | What it does |
|---|---|---|
--grace S | 1 | How many seconds a stranger has to be in view before it locks. |
--threshold X | 0.40 | Match score from which a face counts as you. |
--stranger X | 0.33 | Match score below which a face counts as a stranger. Lower means fewer false alarms, but a lookalike has an easier time. |
--no-input-lock | lock is on | Don't lock when someone touches the Mac with nobody in view. |
--stealth | off | Camera off until someone touches the Mac. --grace and --no-input-lock don't do anything here. |
In the terminal, camera permission belongs to whatever app you run mog in (Terminal, iTerm, Ghostty…).
~/.config/mog/profile.json, readable only by you. It's just numbers, 512 per sample, and they can't be turned back into a picture.~/.config/mog/intruders/, only the latest 20 are kept, and they never leave your Mac.mog update. That downloads one small file from GitHub, and nothing gets sent.Heads up: the intruder photo takes pictures of people without asking them. Depending on where you live, or your company's rules on a work laptop, that might not be okay. Check before you turn it on.
Mog is an extra layer, not real security.
SACLockScreenImmediate). Fine for a personal tool, but Apple wouldn't allow it in the App Store.Keep your password, FileVault and normal auto-lock turned on.
git clone https://github.com/AmazingCarbon/mog && cd mog
./Scripts/fetch-model.sh # downloads the 110 MB model, checks it, compiles it
swift build -c release # the CLI: .build/release/mog
./Scripts/build-app.sh # the app: .build/Mog.app, model included
swift run MogChecks # tests for the lock rules, matching, alignment and storage
| Folder | What's in it |
|---|---|
Sources/MogCore | The logic: lock rules, matching, alignment math, saving your profile. |
Sources/MogEngine | Camera, Vision, Core ML, locking, intruder photo, installer. Shared by the CLI and the app. |
Sources/mog | The command-line tool. |
Sources/MogBar | The menu bar app. |
Assets | The app icon. Rebuild it with ./Scripts/make-icons.sh. |
Swift
98.6%
Shell
1.4%