Lock your Mac instantly in a coffee shop
You close the lid, walk to the counter for a refill, and for a few minutes your Mac is still unlocked to anyone who opens it. The fix is one setting: tell macOS to require your password the instant the screen sleeps. Set it to Immediately and closing the lid — or a single keyboard shortcut — puts up the login wall before you've left the table.
Why the cafe scenario catches people out
By default, macOS gives you a grace period after the screen sleeps before it asks for a password again. That default exists so a display that dims at your own desk doesn't nag you. In a coffee shop it works against you: the lid is shut, the screen is dark, and the machine looks locked — but someone who lifts the lid within that window walks straight into your open session. Mail, Messages, saved passwords, and whatever you had on screen are all right there.
The scenario that bites hardest is the "quick" one. You leave the laptop to grab a napkin or answer the barista, expecting to be back in ten seconds. That is exactly the window a grab-and-go thief needs, and it's the window an over-the-shoulder snoop uses to read your screen. Setting the delay to zero removes the window entirely.
Set it in System Settings
- Open System Settings from the Apple menu.
- Click Lock Screen in the sidebar.
- Find Require password after screen saver begins or display is turned off.
- Choose Immediately from the dropdown.
That's the whole change, and it behaves the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia. From now on, the moment the display sleeps — lid closed, Hot Corner triggered, or idle timeout reached — your password is required to get back in. If you have a Mac with Touch ID, you'll still just tap the sensor; "require password" means the session is locked, not that Touch ID stops working.
Lock on purpose before you stand up
Immediate locking is only as fast as the screen going to sleep, so pair it with a deliberate lock instead of waiting for the idle timer:
- Control + Command + Q locks the screen right now, no menus.
- Closing the lid sleeps the display instantly, which with this setting means an instant lock.
- A Hot Corner set to Lock Screen or Start Screen Saver lets you flick the pointer to a corner on your way up.
The habit worth building: hit Control+Command+Q the second you push your chair back. With the delay at zero, that keystroke is a true lock, not a five-minute suggestion.
The Terminal route
If you'd rather set it from the command line, the same preference lives in the com.apple.screensaver domain:
# Require the password the instant the screen sleeps
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
To undo it and restore a grace period — say, five minutes — write a non-zero delay, or delete the keys to fall back to the system default:
# Undo: restore a 5-minute grace period
defaults write com.apple.screensaver askForPasswordDelay -int 300
# or remove the keys entirely
defaults delete com.apple.screensaver askForPasswordDelay
defaults delete com.apple.screensaver askForPassword
On macOS 14 and 15 the Lock Screen dropdown is the setting macOS reads at the login wall; the Terminal keys write to that same preference. If a Terminal change ever doesn't seem to take, open System Settings → Lock Screen once to confirm the dropdown shows Immediately.
Mainspring turns "require password immediately" into a labelled, reversible toggle — no dropdown hunting, no Terminal. It's one of 90+ hidden macOS settings you can flip on before your next cafe session and flip back at home.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
Make the lock a reflex
Immediate locking pays off most when locking is muscle memory. Learn the fastest ways to trigger it in the lock screen shortcut on Mac, so the keystroke and the zero-delay setting work as one move.