← All posts

Safety ·

Hands Off the Keyboard: TRMNLY Can Lock Your Mac While the Agent Drives It

Agent Lock blocks your keyboard and mouse and covers every screen while an agent run is in progress. If TRMNLY crashes mid-run, a separate watchdog process locks the real macOS screen.

A glass padlock glowing cyan from within, beside a dark glass keyboard

When an agent is clicking through a browser or running an overnight migration, one stray keystroke can wreck the run. That keystroke might come from you, a colleague walking past, or a cat. Agent Lock keeps everyone's hands off the Mac until the run is done.1,2

What it blocks

Click Lock Desktop in the sidebar rail to arm it. While it's armed:1

  • An overlay covers every connected display, at the same level macOS uses for its own lock screen, so it sits above fullscreen apps.
  • Keyboard, mouse, trackpad and system hotkeys (Cmd-Tab, Cmd-Q, Mission Control, brightness and function keys) are dropped at the HID level, before WindowServer sees them.
  • A power assertion keeps the Mac from idle-sleeping during the run.

The input blocking is built on a macOS event tap. Event taps are Apple's filters for watching and changing the stream of low-level input events.1,3

The agent's clicks still get through

Agent tools that send real keystrokes and mouse events go through an event source the tap lets through while the lock is armed. The agent's clicks reach the screen and yours don't.1

Getting back in

Click Unlock, or press any key. macOS asks for your account password or Touch ID, and once you pass, your input works again right away.1,2,4 Closing the lid or locking the session also works as an escape hatch, because the macOS login screen asks for the same credentials when you come back.1

The lock won't pretend to hold when it can't. If VoiceOver or Switch Control is on, it refuses to arm, because those paths can get around the input tap. If either one is switched on mid-run, the status card raises an alarm. It doesn't disarm on its own, because disarming automatically would be the bypass.1

If TRMNLY dies, the screen still locks

The lock lives inside the app, so a crash used to take it down with it. TRMNLY's source records this happening on August 3, 2026: a tool call raised an uncatchable exception two minutes into an armed session, and the lock vanished.5

TRMNLY 0.1.43 added an out-of-process watchdog.6 When you arm the lock, TRMNLY starts a second process that waits for word from the app. A clean disarm sends that word and the watchdog exits quietly. A crash, a force quit or kill -9 sends nothing, and the watchdog locks the real macOS screen.1,5 A separate process is the only option here, because no handler inside the app can catch SIGKILL.5,7

While the lock is armed, ordinary termination signals (a kill <pid> from an SSH session, say) are ignored. sudo kill -9 and pulling the power still work, and then the watchdog covers the gap.1

Failing open on purpose

If the input tap can't be installed, or stops working because Accessibility or Input Monitoring permission was revoked, the lock disarms itself and says why. TRMNLY's docs put it this way: "Better an unlocked agent than a screen you can't get out of."1

Sources

  1. 1.TRMNLY docs, "Agent Lock." trmnly.dev/docs/agent-lock
  2. 2.TRMNLY changelog, 0.1, "Agent lock" (May 13, 2026).
  3. 3.Apple Developer Documentation, "Quartz Event Services." developer.apple.com
  4. 4.Apple Developer Documentation, "Local Authentication." developer.apple.com
  5. 5.TRMNLY source, macos/Sources/Features/Lock/AgentLockFailsafeWatchdog.swift.
  6. 6.TRMNLY changelog, 0.1.43, "Agent lock survives a crash" (August 4, 2026).
  7. 7.POSIX <signal.h>, SIGKILL: "Kill (cannot be caught or ignored)." pubs.opengroup.org