Native biometric application shield and intruder defense system for macOS.
Instant neural camera verification on app-switch, intruder capture with night HDR lift, Telegram alerts, and anti-spoofing walk-away lock.
FaceLock transforms your Mac’s built-in FaceTime HD / TrueDepth camera into an active biometric barrier. Whenever an unauthorized person touches your Mac or attempts to switch windows, FaceLock intercepts the action within milliseconds, snapshots the intruder, sends an instant alert to your Telegram, and enforces a fullscreen lock that cannot be bypassed via standard shortcuts.
Built strictly in modern Swift & native AppKit, with zero external package dependencies and zero cloud telemetry. Everything runs 100% on-device on the Apple Neural Engine.
┌────────────────┐
│ Window Switch │ (NSWorkspace.didActivateApplicationNotification)
└───────┬────────┘
│
▼
┌────────────────┐ ┌─────────────────────────────┐
│ Low-Light Cam ├─────►│ Apple Neural Engine │
│ (AVFoundation) │ │ (Vision ANFRv4 128-D Vector)│
└────────────────┘ └──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ Dual-Verification Evaluator │
│ d_min ≤ 0.22 & top3 ≤ 0.27 │
└──────┬───────────────┬──────┘
│ │
[MATCH] │ │ [MISMATCH / TIMEOUT]
┌──────────────────────┘ └──────────────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ HUD Confirmation │ │ Intruder Defense │
│ Seamless Pass │ │ • Night HDR Pic │
└──────────────────┘ │ • Telegram Alert│
│ • Shield Lock │
└──────────────────┘
-
⚡️ Sub-Second Neural Verification: Computes 128-dimensional biometric embeddings on the Apple Neural Engine (
VNCreateFaceprintRequest). Matches owner facial contours with strict cosine distance thresholds ($d \le 0.22$ ). -
🛡️ Unbypassable Fullscreen Shield: Renders a dark glassmorphic barrier at
.screenSaverwindow level (CGWindowLevelForKey(.screenSaverWindow)). Intercepts Esc, Cmd+Q, Cmd+W, Cmd+M, and system overlays. - 📸 Intruder Snapshot & Night-Mode Lift: Automatically crops intruder faces with 80% shoulder headroom. Applies low-light exposure boosting (+1.3 EV) and tone curve equalization so faces remain crystal clear in dark rooms.
- 📱 Instant Telegram Bot Alerts: Dispatches the intruder’s high-resolution photograph, exact timestamp, and targeted application directly to your private Telegram chat via official Bot API.
- 👥 Shoulder-Surfing Defense: Neural camera detects if an unauthorized bystander is peeking over your shoulder while you work, triggering a discrete HUD alert or protective shield.
-
🎯 Dynamic Security Profiles:
-
normal: Balanced 45s walk-away, silent intruder capture, standard threshold. -
cafe: Ultra-strict 10s walk-away, active shoulder-surfing defense, lock-on-wake, and audible alarm. -
work: Confidential apps whitelist, 45s walk-away, Telegram notifications. -
home: Relaxed 180s walk-away, friendly HUD, expanded tolerance. -
presentation: Focus mode with automatic lock suppression during Keynote, Zoom, Meet, or full-screen gaming.
-
-
🔋 Battery-Aware Adaptive Polling: Senses power state (
IOPSGetProvidingPowerSourceType) and intelligently throttles idle scans when unplugged to conserve MacBook battery life. -
🚶♂️ Walk-Away Auto Lock: Monitors user idle state (
CGEventSource). If keyboard/mouse are inactive, FaceLock silently verifies presence via camera. If you stepped away, the Mac locks immediately. - 👁️ Anti-Spoofing Liveness: Analyzes 3D facial capture quality to thwart 2D screen or paper printout spoof attacks.
-
🎛️ Native Menu Bar, UI Gallery & Audit Log:
- Profile switcher, 3D face calibration wizard, dynamic camera switcher.
- Interactive Incident Gallery with 24h / 7d period filtering and one-click pruning.
- Security Audit Log viewer with category filtering, pruning, and JSONL/CSV/JSON export.
-
🩺 152-Check Diagnostic Doctor & Multi-Engine Compliance Suite: Comprehensive health, biometrics, hardware, and filesystem diagnostic doctor (
make doctor) with auto-repair (make doctor-repair), responsive HTML5 dashboard export (make doctor-export-html), OASIS SARIF v2.1.0 compliance export (make doctor-export-sarif), enterprise RFC 4180 CSV export (make doctor-export-csv), CI/CD JUnit XML export (make doctor-export-junit), native GitHub Actions Step Summary & workflow annotations export (make doctor-export-gha), GitLab CI / Code Climate code quality export (make doctor-export-gitlab), SonarQube Generic Issue Import JSON export (make doctor-export-sonarqube), DefectDojo Generic Findings JSON export (make doctor-export-defectdojo), OWASP CycloneDX 1.5 DevSecOps BOM / VEX JSON export (make doctor-export-cyclonedx), ISO/IEC 5962:2021 / SPDX 2.3 SBOM export (make doctor-export-spdx), OASIS CSAF 2.0 DevSecOps Advisory export (make doctor-export-csaf), OpenVEX 0.2.0 Vulnerability Exploitability eXchange export (make doctor-export-openvex), OASIS STIX 2.1 Cyber Threat Intelligence & Vulnerability Bundle export (make doctor-export-stix), MITRE ATT&CK® Navigator Matrix Layer v4.5 export (make doctor-export-attack), NIST OSCAL 1.1.0 Assessment Results JSON export (make doctor-export-oscal), NIST CSF 2.0 Cybersecurity Framework JSON export (make doctor-export-csf), CIS Controls v8 Cybersecurity Assessment JSON export (make doctor-export-cis), ISO/IEC 27001:2022 Annex A Controls JSON export (make doctor-export-iso27001), AICPA SOC 2 Type II Trust Services Assessment JSON export (make doctor-export-soc2), PCI-DSS v4.0 Security Assessment JSON export (make doctor-export-pcidss), HIPAA Security Rule Assessment JSON export (make doctor-export-hipaa), GDPR Data Protection Assessment JSON export (make doctor-export-gdpr), NIST SP 800-53 Rev. 5 Security & Privacy Controls Assessment JSON export (make doctor-export-nist80053), European Union NIS2 Directive (Directive (EU) 2022/2555) Article 21 Cybersecurity Risk-Management Assessment JSON export (make doctor-export-nis2), European Union DORA Regulation (Regulation (EU) 2022/2554) Digital Operational Resilience Assessment JSON export (make doctor-export-dora), Australian Cyber Security Centre (ACSC) Essential Eight Maturity Model Assessment JSON export (make doctor-export-essential8), UK National Cyber Security Centre (NCSC) Cyber Essentials Assessment JSON export (make doctor-export-cyber-essentials/make doctor-export-ce), and German Federal Office for Information Security (BSI) IT-Grundschutz Assessment JSON export (make doctor-export-bsi/make doctor-export-grundschutz) for German BSI IT-Grundschutz federal compliance, NCSC UK Cyber Essentials infrastructure security verification, ACSC Essential Eight maturity auditing, European Union DORA financial operational resilience compliance, European Union NIS2 Directive compliance, NIST SP 800-53 Rev. 5 federal compliance, EU GDPR Article 9/25/32 biometric data protection, HIPAA Security Rule healthcare workstation compliance, PCI-DSS v4.0 payment security audits, AICPA SOC 2 Type II audit readiness, MITRE ATT&CK Navigator visualization, NIST OSCAL GRC compliance, NIST CSF 2.0 enterprise alignment, CIS Controls v8 benchmark auditing, ISO/IEC 27001:2022 certification mapping, GitHub Code Scanning, GitLab CI/CD, SonarQube / SonarCloud, DefectDojo DevSecOps vulnerability management, CycloneDX / SPDX software supply chain compliance, OASIS CSAF 2.0 automated security advisory exchange, OpenVEX 0.2.0 exploitability statements, OASIS STIX 2.1 SIEM / SOAR / OpenCTI ingestion, SOC 2 / ISO 27001 audit spreadsheets, and fleet MDM pipelines. -
🧪 100% Automated Test Suite: 23,000+ unit tests and microsecond Apple Silicon vector benchmarks built directly into the binary (
make test).
| Capability | macOS Screen Lock | Commercial Lock Apps (Sensei / AppLocker) | Windows Hello (PC) | FaceLock (macOS) |
|---|---|---|---|---|
| Per-App Focus Shield | ❌ No | ❌ No | ✅ Instant Neural Face Check | |
| Intruder Photo with Night HDR | ❌ No | ❌ No | ✅ +1.3 EV Exposure Lift & Crop | |
| Instant Telegram Phone Alerts | ❌ No | ❌ No | ❌ No | ✅ Photo + Timestamp + App |
| Shoulder-Surfing Bystander Defense | ❌ No | ❌ No | ✅ Multi-face Neural Detection | |
| Security Profiles (Cafe/Work/Home) | ❌ No | ❌ No | ❌ No | ✅ 5 Specialized Context Profiles |
| Walk-Away Camera Inactivity Defense | ✅ CGEvent + Silent Neural Camera | |||
| Presentation Mode Auto-Suppression | ❌ | ❌ | ✅ Keynote / Zoom Auto-Detect | |
| Apple Neural Engine Acceleration | ❌ | ❌ | ❌ (x86 / Intel) | ✅ 100% On-Device Apple Silicon |
| Privacy & Zero Telemetry | ✅ Local | ❌ Cloud telemetry / tracking | ✅ 100% On-Device, Zero Analytics | |
| License & Price | Proprietary | $15 – $35 recurring | Vendor-locked | ✅ 100% Free & Open Source (MIT) |
Install directly via the official Homebrew tap:
brew install --cask MaxSphinx/facelock/facelockOpen Terminal and paste:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/MaxSphinx/FaceLock/main/scripts/install.sh)"Download the signed archive directly from GitHub Releases:
- Download
FaceLock-macOS-arm64.zip. - Extract and drag
FaceLock.appinto/Applications/.
git clone https://github.com/MaxSphinx/FaceLock.git
cd FaceLock
make installTrain FaceLock with your face under multiple angles:
facelock --enrollLook at the camera and slowly tilt your head up, down, left, and right. FaceLock records 12 diverse neural vectors.
Receive intruder photos on your phone:
- Message @BotFather on Telegram and send
/newbotto create your alert bot. - Get your numeric User ID from @userinfobot.
- Open settings:
facelock --settings- Enter your Bot Token and Chat ID, then click «Тест бота» to confirm.
facelock --statusFaceLock comes with a first-class command-line interface:
| Command | Description |
|---|---|
facelock --enroll |
Launch interactive camera calibration wizard |
facelock --settings |
Open configuration GUI (Telegram, PIN, App lists) |
facelock --gallery |
Open captured intruder incident gallery |
facelock --lock |
Trigger immediate fullscreen security shield |
facelock --lockdown |
Engage emergency lockdown: switch to lockdown profile & seal screen |
facelock --toggle |
Toggle protection between ACTIVE and PAUSED |
facelock --pause [mins] |
Pause protection for N minutes (default: 15) |
facelock --resume |
Resume protection immediately |
facelock --reload |
Hot-reload active configuration in running background daemon |
facelock --check-app <bundleId> |
Inspect whether bundle ID triggers biometric shield |
facelock --config [--json] |
Display active FaceLock configuration settings |
facelock --apps [--json] |
List protected and ignored application bundle IDs |
facelock --apps-gui |
Open interactive application protection policy manager window |
facelock --protect-app <id> |
Add application bundle ID to protected list |
facelock --unprotect-app <id> |
Remove application bundle ID from protected list |
facelock --ignore-app <id> |
Add application bundle ID to ignored list |
facelock --unignore-app <id> |
Remove application bundle ID from ignored list |
facelock --reset-apps [--json] |
Reset protected and ignored application lists to factory defaults |
facelock --profiles [--json] |
List available security profiles (normal, cafe, work, home, presentation) |
facelock --profile <name> |
Switch active security profile (e.g. facelock --profile cafe) |
facelock --toggle-shoulder-defense |
Toggle shoulder-surfing bystander detection shield |
facelock --toggle-audible |
Toggle audible alarm deterrent chimes |
facelock --toggle-battery-aware |
Toggle battery-aware adaptive idle sweep throttling |
facelock --toggle-presentation |
Toggle meeting / presentation lock auto-suppression |
facelock --test |
Execute 100% automated test suite & vector benchmark |
facelock --set-pin <pin> |
Set lock screen unlock PIN from terminal |
facelock --set-pin-attempts <count> |
Set max failed PIN attempts before lockout (1-10, default: 3) |
facelock --set-pin-lockout <sec> |
Set cooling lockout delay after failed PIN attempts (1-60s, default: 5s) |
facelock --set-telegram <tok> <id> |
Configure Telegram bot credentials and enable alerts |
facelock --enable-telegram |
Enable Telegram intruder photo alerts |
facelock --disable-telegram |
Disable Telegram intruder alerts |
facelock --set-liveness <on|off> |
Toggle anti-spoofing 3D liveness detection |
facelock --set-touchid <on|off> |
Toggle Touch ID fallback on lock screen |
facelock --set-lock-on-wake <on|off> |
Toggle biometric verification upon screen wake |
facelock --reset-session |
Clear cached verification session & force immediate re-authentication |
facelock --backup-config, --export-config <path> |
Backup active FaceLock configuration to JSON |
facelock --restore-config, --import-config <path> |
Restore FaceLock configuration from JSON |
facelock --vectors [--json] |
Inspect enrolled biometric facial vectors & cluster metrics |
facelock --vector-consistency [--json] |
Analyze cluster cohesion score, medoid index & angle diversity |
facelock --optimize-vectors [--json] |
Prune redundant face vectors & outliers to optimize cluster compactness |
facelock --export-vectors <path> |
Backup enrolled face vectors to JSON file |
facelock --import-vectors <path> |
Restore or merge face vectors from JSON file |
facelock --health [--json] |
Operational healthcheck (exit 0 if healthy) |
facelock --is-locked [--json] |
Check whether screen lock shield is currently engaged |
facelock --set-walkaway <sec|off> |
Configure walk-away timeout (10-600s) or disable ('off') |
facelock --set-threshold <val> |
Set similarity threshold (0.05 - 0.60, default: 0.22) |
facelock --set-timeout <sec> |
Set camera verification timeout (0.5 - 10.0s, default: 2.0s) |
facelock --set-debounce <sec> |
Set app switch debounce interval (0.5 - 30.0s, default: 2.0s) |
facelock --set-mode <mode> |
Set mode: 'all' (every app) or 'selective' (secret apps) |
facelock --cameras [--json] |
List available video capture cameras and active selection |
facelock --set-camera <id|name|default> |
Select preferred video camera by device ID, name substring or 'default' |
facelock --reset-camera [--json] |
Reset preferred camera selection to default front camera |
facelock --diagnostics |
Run full biometric, hardware & storage diagnostics |
facelock --diagnostics-gui |
Open interactive system diagnostics & healthcheck window |
facelock --doctor [--json] |
Comprehensive 56-check pre-flight & runtime health diagnostic doctor |
facelock --doctor-strict [--json] |
Strict mode doctor (fails with exit code 1 if any warning is detected) |
facelock --doctor-repair [--json] |
Auto-remediate doctor health issues (permissions, audit, posture) |
facelock --doctor-markdown [--json] |
Generate comprehensive health doctor report in Markdown format |
facelock --doctor-html [--json] |
Generate responsive standalone HTML5 diagnostic dashboard |
facelock --doctor-sarif [--json] |
Generate OASIS SARIF v2.1.0 security compliance report |
facelock --doctor-csv [--json] |
Generate enterprise RFC 4180 CSV compliance audit report |
facelock --doctor-junit [--json] |
Generate CI/CD JUnit XML security compliance report |
facelock --doctor-gha [--json] |
Generate CI/CD GitHub Actions Step Summary & workflow annotations report |
facelock --doctor-gitlab [--json] |
Generate GitLab CI / Code Climate code quality JSON report |
facelock --doctor-sonarqube [--json] |
Generate SonarQube Generic Issue Import JSON compliance report |
facelock --doctor-defectdojo [--json] |
Generate DefectDojo Generic Findings JSON compliance report |
facelock --doctor-cyclonedx [--json] |
Generate OWASP CycloneDX 1.5 DevSecOps BOM JSON compliance report |
facelock --doctor-spdx [--json] |
Generate ISO/IEC 5962:2021 / SPDX 2.3 DevSecOps SBOM JSON report |
facelock --doctor-csaf [--json] |
Generate OASIS CSAF 2.0 DevSecOps Security Advisory JSON report |
facelock --doctor-openvex [--json] |
Generate OpenVEX 0.2.0 Vulnerability Exploitability eXchange JSON report |
facelock --doctor-stix [--json] |
Generate OASIS STIX 2.1 Cyber Threat Intelligence & Vulnerability JSON report |
facelock --doctor-attack [--json] |
Generate MITRE ATT&CK® Navigator Matrix Layer v4.5 JSON report |
facelock --doctor-oscal [--json] |
Generate NIST OSCAL 1.1.0 Assessment Results JSON compliance report |
facelock --doctor-csf [--json] |
Generate NIST CSF 2.0 Cybersecurity Framework JSON compliance report |
facelock --doctor-cis [--json] |
Generate CIS Controls v8 Cybersecurity Assessment JSON report |
facelock --doctor-iso27001 [--json] |
Generate ISO/IEC 27001:2022 Annex A Controls JSON assessment report |
facelock --doctor-soc2 [--json] |
Generate AICPA SOC 2 Type II Assessment JSON report |
facelock --doctor-pcidss [--json] |
Generate PCI-DSS v4.0 Security Assessment JSON report |
facelock --doctor-hipaa [--json] |
Generate HIPAA Security Rule Assessment JSON report |
facelock --doctor-gdpr [--json] |
Generate GDPR Data Protection Assessment JSON report |
facelock --doctor-nist80053 [--json] |
Generate NIST SP 800-53 Rev. 5 Security & Privacy Controls Assessment JSON report |
facelock --doctor-nis2 [--json] |
Generate EU NIS2 Directive Cybersecurity Risk-Management Assessment JSON report |
facelock --doctor-dora [--json] |
Generate EU DORA Regulation Digital Operational Resilience Assessment JSON report |
facelock --doctor-essential8 [--json] |
Generate ACSC Essential Eight Maturity Model Assessment JSON report |
facelock --doctor-cyber-essentials [--json] |
Generate NCSC UK Cyber Essentials Assessment JSON report (alias: --doctor-ce) |
facelock --doctor-bsi [--json] |
Generate BSI IT-Grundschutz Assessment JSON report (alias: --doctor-grundschutz) |
facelock --doctor-export [path] |
Export health doctor report to JSON file |
facelock --doctor-export-md [path] |
Export health doctor report to Markdown file |
facelock --doctor-export-html [path] |
Export health doctor report to HTML5 dashboard file |
facelock --doctor-export-sarif [path] |
Export health doctor report to SARIF v2.1.0 file |
facelock --doctor-export-csv [path] |
Export health doctor report to CSV file |
facelock --doctor-export-junit [path] |
Export health doctor report to JUnit XML file |
facelock --doctor-export-gha [path] |
Export health doctor report to GitHub Actions Step Summary file |
facelock --doctor-export-gitlab [path] |
Export health doctor report to GitLab CI Code Quality JSON file |
facelock --doctor-export-sonarqube [path] |
Export health doctor report to SonarQube Generic Issue Import JSON file |
facelock --doctor-export-defectdojo [path] |
Export health doctor report to DefectDojo Generic Findings JSON file |
facelock --doctor-export-cyclonedx [path] |
Export health doctor report to CycloneDX 1.5 BOM JSON file |
facelock --doctor-export-spdx [path] |
Export health doctor report to SPDX 2.3 SBOM JSON file |
facelock --doctor-export-csaf [path] |
Export health doctor report to OASIS CSAF 2.0 Security Advisory JSON file |
facelock --doctor-export-openvex [path] |
Export health doctor report to OpenVEX 0.2.0 JSON file |
facelock --doctor-export-stix [path] |
Export health doctor report to OASIS STIX 2.1 JSON file |
facelock --doctor-export-attack [path] |
Export health doctor report to MITRE ATT&CK Navigator Layer JSON file |
facelock --doctor-export-oscal [path] |
Export health doctor report to NIST OSCAL 1.1.0 Assessment Results JSON file |
facelock --doctor-export-csf [path] |
Export health doctor report to NIST CSF 2.0 JSON file |
facelock --doctor-export-cis [path] |
Export health doctor report to CIS Controls v8 JSON file |
facelock --doctor-export-iso27001 [path] |
Export health doctor report to ISO/IEC 27001:2022 JSON file |
facelock --doctor-export-soc2 [path] |
Export health doctor report to AICPA SOC 2 Type II JSON file |
facelock --doctor-export-pcidss [path] |
Export health doctor report to PCI-DSS v4.0 JSON file |
facelock --doctor-export-hipaa [path] |
Export health doctor report to HIPAA Security Rule JSON file |
facelock --doctor-export-gdpr [path] |
Export health doctor report to GDPR Data Protection JSON file |
facelock --doctor-export-nist80053 [path] |
Export health doctor report to NIST SP 800-53 Rev. 5 file |
facelock --doctor-export-nis2 [path] |
Export health doctor report to EU NIS2 Directive file |
facelock --doctor-export-dora [path] |
Export health doctor report to EU DORA Regulation file |
facelock --doctor-export-essential8 [path] |
Export health doctor report to ACSC Essential Eight file |
facelock --doctor-export-cyber-essentials [path] |
Export health doctor report to NCSC Cyber Essentials file (alias: --doctor-export-ce) |
facelock --doctor-export-bsi [path] |
Export health doctor report to BSI IT-Grundschutz file (alias: --doctor-export-grundschutz) |
facelock --test-lock |
Trigger fullscreen security shield test |
facelock --status |
Display daemon status and biometric template metrics |
facelock --incidents [--json] |
List logged intruder incident captures and disk usage |
facelock --incidents-summary [--json] |
Telemetry summary: total, 24h & 7d counts, size, timestamps |
facelock --incidents-integrity [--json] |
Check intruder capture files for truncated or corrupted headers |
facelock --repair-incidents [--json] |
Safely prune corrupted and zero-byte incident captures |
facelock --incident <filename> |
Inspect details of a specific intruder incident photo |
facelock --delete-incident <file> |
Delete a specific intruder incident photo from disk |
facelock --latest-incident [--json] |
Inspect details of the most recent intruder capture |
facelock --export-latest-incident <p> |
Copy latest intruder photo capture to destination path |
facelock --export-incident <f> <p> |
Copy specific intruder photo capture to destination path |
facelock --export-incidents <dir> [--type T] |
Export captured intruder photos and JSON manifest to directory (optional type filter) |
facelock --clear-incidents [--type T] |
Purge saved intruder incident captures (optionally filtered by type) |
facelock --prune-incidents <n> |
Prune intruder captures keeping latest N photos |
facelock --audit [--tail N] [--type T] [--query Q] |
View security audit log trail with category and query filtering |
facelock --audit-search <query> [--json] |
Search audit log events across app name, bundle ID, details and event type |
facelock --audit-stats [--json] |
Show security audit statistics, success rates and event breakdown |
facelock --audit-summary [--json] |
Analytical audit digest: verification success rate & challenged apps |
facelock --clear-audit |
Purge all security audit log events from disk |
facelock --export-audit <path> [--type T] [--format F] |
Export audit log events to file (JSONL, JSON array, or RFC-4180 CSV) |
facelock --export-audit-csv <path> |
Export security audit log events directly to RFC-4180 CSV file |
facelock --verify-face [--timeout] |
Instant one-shot facial biometric check without locking |
facelock --verify-pin <pin> |
Verify candidate PIN against active lock screen PIN |
facelock --test-telegram |
Dispatch verification alert to configured Telegram chat |
facelock --reset |
Purge all enrolled facial vectors |
facelock --version |
Output version and platform architecture |
facelock --help |
Show comprehensive CLI guide |
To have FaceLock start automatically upon login:
cat << 'EOF' > ~/Library/LaunchAgents/io.github.facelock.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.github.facelock</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/FaceLock.app/Contents/MacOS/FaceLock</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOF
launchctl load ~/Library/LaunchAgents/io.github.facelock.plistTo stop and unload:
launchctl unload ~/Library/LaunchAgents/io.github.facelock.plist- No Cloud Dependencies: FaceLock operates completely offline (except optional Telegram alert dispatches initiated directly by your own bot token to Telegram's HTTPS endpoint).
- No Third-Party Analytics: Zero tracking, zero telemetry, zero analytics libraries.
- Biometric Storage: Facial representations are stored strictly as 128-float mathematical embeddings in
~/.facelock/owner_face_vectors.json. Original training camera frames are discarded immediately after vector extraction. - Hardware Acceleration: All image tensor transformations leverage the Apple Neural Engine (ANE) via Apple's Vision framework, ensuring minimal CPU usage and negligible battery impact.
Settings are stored at ~/.facelock/config.json:
{
"isEnabled": true,
"protectionMode": "all",
"similarityThreshold": 0.22,
"verificationTimeout": 2.0,
"debounceSeconds": 2.0,
"walkAwayLockEnabled": true,
"walkAwayIdleSeconds": 45.0,
"livenessDetectionEnabled": true,
"telegramEnabled": false,
"telegramBotToken": "",
"telegramChatId": "",
"pin": "0000",
"autoTriggerTouchID": true,
"showHUD": true
}Нажмите, чтобы развернуть описание на русском
Основные возможности
-
Биометрия Apple Vision (ANFRv4): Сравнение 128-мерных векторов лица на Apple Neural Engine с порогом
$d \le 0.22$ . Исключает ложные срабатывания на посторонних. -
Экран блокировки уровня
.screenSaver: Перекрывает систему, блокирует горячие клавиши (Cmd+Q, Cmd+W, Esc) и разблокируется только по Touch ID или PIN. - Ночной режим фотосъемки: Автоматическое осветление теней и подъем экспозиции (+1.3 EV) при съемке нарушителя в темной комнате.
- Мгновенные алерты в Telegram: Отправка фото нарушителя, имени приложения и точного времени прямо в ваш Telegram-чат.
- Авто-замок при уходе: Если за Mac никого нет 45 секунд, FaceLock проверяет камеру и блокирует экран при отсутствии пользователя.
Установка в одну команду
git clone https://github.com/MaxSphinx/FaceLock.git
cd FaceLock
make installContributions, bug reports, and feature requests are welcome! Feel free to open an issue or submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
If FaceLock protects your MacBook or you find it useful, please consider giving it a Star on GitHub — it directly supports future development and features!
Distributed under the MIT License. See LICENSE for more information.

