A private key in a file can be copied. With a FIDO security key, part of the key stays in the hardware, and OpenSSH supports that directly.
The key type is ed25519-sk. Plug in the security key and run:
ssh-keygen -t ed25519-sk -C "laptop-key"
The comment is only a label. The files are named like the other key types, for example ~/.ssh/id_ed25519_sk, and the public part goes into authorized_keys as usual. The manual explains how it works: the key consists of a key handle stored in the private key file on disk, and a per-device private key that is unique to each authenticator and cannot be exported from the hardware. The two are combined at authentication time. You can use the key like any other type, as long as the authenticator is attached, and these devices generally want a touch or tap to approve each operation.
Options for it go through -O:
-O residentstores the key handle on the authenticator itself, which makes it easier to use on several computers and typically needs a PIN set on the device first-O verify-requiredasks for user verification for each signature, which for now means the PIN, and not every authenticator supports it-O no-touch-requireddrops the touch, and the manual notes that sshd refuses such signatures by default unless an authorized_keys option overrides it
A resident key can be downloaded from the device again with ssh-keygen -K, which writes the key files to the current directory.
The caveats come from the same page. Storing both parts of the key on the authenticator, with resident, makes it more likely that an attacker can use a stolen device. And because the per-device private key cannot be exported, a lost or broken key means that private part is gone. Register a second security key, and keep another way into the server until you have tested both.
Further reading: ssh-keygen man page