Require your Mac password the moment it sleeps
Wake your Mac from sleep and — unless you've changed it — there's a short window where it lands straight on your desktop with no password asked. That's the default grace period, and it means "asleep" and "locked" are not the same thing. Set the requirement to Immediately and every wake from sleep starts at the login window.
Asleep is not the same as locked
People assume a sleeping Mac is a secure Mac. It isn't, by default. macOS treats the first few minutes after the screen sleeps as a convenience buffer: if you nudge the trackpad or press a key within that window, it wakes to exactly where you left off — no password. The idea is to spare you from re-authenticating when the display dims briefly at your own desk.
The cost is that anyone who wakes the machine inside that buffer gets your live session. Whether the lid was closed for two minutes or the screen dimmed on its own, the lock you think is protecting you hasn't engaged yet. Changing one setting collapses that gap so that sleep and lock happen together.
Change the grace period to zero
- Open System Settings.
- Select Lock Screen in the sidebar.
- Locate Require password after screen saver begins or display is turned off.
- Set it to Immediately.
The dropdown normally offers steps like 5 seconds, 1 minute, 5 minutes, and longer; Immediately is the top choice and it removes the buffer entirely. This works identically on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia. After the change, wake the display and you should see the login window instead of your desktop — that's the confirmation it took.
What "require password" actually gates
- It applies whenever the display sleeps: idle timeout, closing the lid, a Hot Corner, or the screen saver kicking in.
- On Macs with Touch ID you'll still unlock with a fingerprint — the setting decides whether authentication is required, not the method.
- It's independent of your energy settings. You can keep a long display-sleep timer and still lock instantly once sleep does begin.
This is a session lock, not disk encryption. It stops someone from waking into your open session, but it doesn't protect the files on the drive if the disk is removed — that's what FileVault is for, and the two are worth using together.
Set it from Terminal
The preference lives in com.apple.screensaver as two keys: whether to ask, and how long to wait:
# Ask immediately, with no delay
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
To reverse it, restore a delay in seconds, or delete the keys to return to the system default:
# Undo: 60-second grace period
defaults write com.apple.screensaver askForPasswordDelay -int 60
# or clear the keys
defaults delete com.apple.screensaver askForPasswordDelay
defaults delete com.apple.screensaver askForPassword
On macOS 14 and 15 the Lock Screen dropdown is what the login window reads; the Terminal keys write the same preference. If a command doesn't seem to apply, open System Settings → Lock Screen once and confirm the dropdown reads Immediately.
Mainspring makes "require password immediately" a single labelled toggle you can turn on and off without digging through Lock Screen settings. It's one of 90+ hidden macOS tweaks it exposes as reversible switches.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
Pair it with a fast manual lock
Immediate locking is most useful when you can trigger sleep on demand. See requiring a password on sleep on Mac for the shortcuts and Hot Corners that put the screen to sleep the instant you step away.