macOS Keychain Integration
conceptmacOS stores passphrases in Keychain, unlocks them via Touch ID / Face ID, and auto-loads keys into ssh-agent. The result: it feels like hardware security, but it is actually disk-based security + OS trust. The private key still lives on disk.
The behavior is driven by two macOS-specific options in ~/.ssh/config:
UseKeychain yes # Store passphrase in Keychain
AddKeysToAgent yes # Auto-add to ssh-agent
With these set, you type the passphrase once; after that, Keychain supplies it and the agent caches the unlocked key. This is the same session-caching mechanism SSH supports everywhere—ssh-agent and OS keychains—which avoids repeated typing, expires when the session ends, and requires a background process. macOS just wires it all together so smoothly that the passphrase seems to vanish.