Skip to main content

๐Ÿฅ B.R.I.O.S.

Bluetooth Reactive Intelligent Operator for Croissant Safety

Enterprise-grade proximity monitoring for macOS security automation. Automatically lock your Mac when your iPhone, Apple Watch, or any Bluetooth device moves out of range.


What is B.R.I.O.S.?โ€‹

B.R.I.O.S. is a professional BLE (Bluetooth Low Energy) proximity monitoring system for macOS. It continuously tracks the distance between your Mac and a trusted Bluetooth device โ€” such as an iPhone, Apple Watch, or Android phone โ€” and automatically locks your Mac the moment the device moves beyond a configurable distance threshold.

Think of it as a smart, zero-touch security layer: walk away from your desk, and your Mac locks itself. Return, and monitoring resumes seamlessly.


Key Featuresโ€‹

FeatureDescription
๐Ÿ” BLE Device DiscoveryScan and identify nearby Bluetooth Low Energy devices
๐Ÿ“ก Real-Time MonitoringContinuous proximity tracking with RSSI signal analysis
๐Ÿ”’ Automatic LockingInstant macOS screen lock when the device leaves range
โš™๏ธ Highly ConfigurableCustom distance thresholds, calibration, and environment tuning
๐Ÿš€ Background ServiceDaemon mode with full service lifecycle management
๐Ÿ“Š Verbose LoggingDetailed RSSI, smoothed signal, and distance metrics
๐Ÿ›ก๏ธ Lock Loop ProtectionIntelligent safeguards against excessive lock/unlock cycles
๐Ÿ”„ Automatic RecoveryWatchdog and scanner reconnection with exponential backoff
๐Ÿงช 100% Test CoverageComprehensive pytest-based test suite
๐Ÿ”„ CI/CD ReadyGitHub Actions pipeline with formatting, type checks, and security audits

How It Worksโ€‹

B.R.I.O.S. uses the Log-Distance Path Loss Model to estimate the physical distance between your Mac and the target device based on the received Bluetooth signal strength (RSSI):

distance = 10 ^ ((TX_POWER โˆ’ RSSI) / (10 ร— PATH_LOSS_EXPONENT))
  1. Scan: The BLE scanner listens for advertisement packets from the target device.
  2. Smooth: Raw RSSI samples are collected into a rolling buffer and averaged to eliminate noise.
  3. Estimate: The smoothed RSSI is converted to a distance estimate using the path loss model.
  4. Act: If the estimated distance exceeds the configured threshold, macOS locks the screen immediately.
  5. Recover: After the screen is unlocked, B.R.I.O.S. automatically resumes monitoring with a grace period to prevent false re-triggers.

System Requirementsโ€‹

  • macOS 10.15 (Catalina) or later
  • Bluetooth Low Energy adapter (built-in on all modern Macs)
  • Python 3.9+ (installed automatically via Homebrew, only needed manually for source installs)

  • Installation โ€” Get B.R.I.O.S. installed via Homebrew or from source
  • Quick Start โ€” Start monitoring in under 5 minutes
  • Configuration โ€” Full reference for all environment variables
  • CLI Usage โ€” Complete command-line interface reference
  • FAQ โ€” Answers to common questions

Compatibility Noticeโ€‹

Testing & Compatibility

This project has been tested on:

  • Hardware: MacBook Pro M3 Pro with iPhone
  • Python: 3.12.6 (should work on Python 3.9+)
  • OS: macOS (Bluetooth stack is macOS-specific)

Device pairing requirements:

  • If your Mac and iPhone/device use different Apple IDs, you must pair them first in System Settings โ†’ Bluetooth. Otherwise, Apple hides the MAC address and the device won't be discoverable.
  • Android devices should work without pairing requirements.
  • Apple Watch is currently not discoverable from Mac due to Apple's BLE restrictions.

Bluetooth pairing in System Settings

If you encounter issues on other configurations, please report them.