Mac users can now utilize the device's Secure Enclave—a dedicated hardware security module—to store SSH identities that are physically protected from extraction. Unlike traditional SSH keys stored as files in a `~/.ssh` directory, these identities are generated within the enclave and can only be accessed via biometric authentication, such as Touch ID. This setup ensures that even if a machine's file system is compromised, the private key material remains inaccessible because it never leaves the secure hardware.

This visual represents the concept of using the Secure Enclave for hardware-bound SSH keys as described in the article.
To implement this, users can use the `sc_auth` command-line tool to create a "CryptoTokenKit" (CTK) identity. By specifying the `p-256-ne` key type, the system generates a "Non-Extractable" key. To bridge this with standard SSH protocols, macOS provides a translation library called `ssh-keychain.dylib`. By registering this library as a security key provider using the `ssh-add -K -S` command, the SSH agent learns to communicate with the Secure Enclave. When a user attempts to connect to a server (e.g., GitHub), the agent requests a signature from the enclave, which triggers a Touch ID prompt on the Mac.
While this provides high-level security, it introduces a significant trade-off: the keys are hardware-bound. Because the private material cannot be exported, a user who loses their Mac or experiences a hardware failure loses access to those specific identities. This necessitates a robust backup strategy, such as maintaining a secondary physical security key or a paper-based backup of a separate key. Furthermore, while this method removes the risk of accidentally deleting a file, it creates a "one-way street" where the identity is locked to that specific piece of hardware, potentially complicating workflows that require frequent device migration or multi-device synchronization.
Technical nuances include the fact that `ssh-add` may still prompt for a PIN even when using biometrics, as it defaults to a FIDO-style authenticator logic. Additionally, while the `p-256-ne` curve is currently the standard for this workflow, users must ensure they use the `-t bio` protection flag to enforce the biometric requirement, otherwise, the enclave might allow software-only access without a fingerprint check. These configurations ensure that the "sci-fi" style security of the enclave is actually utilized by the operating system's networking stack.
Ultimately, this approach shifts the security model from "something you have" (a file on a disk) to "something you are" (a biometric signature) combined with a hardware-locked secret. It effectively eliminates the risk of key theft via file-system access but requires users to accept the permanence of the hardware link. For those who need more flexibility, alternative methods like using a local password store protected by Touch ID to decrypt standard SSH keys remain an option for those who require portable key backups.
The mechanism relies on the `_sk_load_resident_keys` and `_sk_sign` symbols exported by the `ssh-keychain.dylib` library. These allow the SSH agent to discover the public keys residing in the enclave and request the enclave to perform the cryptographic signing of challenges. This flow mirrors how FIDO2 security keys work, but replaces an external USB device with the internal silicon of the Mac's processor.
One limitation noted by users is that not all applications or protocols can interface with the Secure Enclave in the same way. While it works seamlessly for standard SSH and Git-over-SSH, it may not be compatible with every custom authentication flow. Users should also be aware that because the identity is non-extractable, they cannot simply copy the key to a new computer; they must generate a new identity and register it with their service providers whenever they switch hardware.