How to use YubiKey for unlocking - solution

I think your idea has merit for some scenarios. Thanks for sharing it.

A lot of people have been requesting a touch Yubikey to unlock feature… this is sort of a work-around to accomplish the same thing.

For additional context, I just wanted to mention one thing about the PIN security: Bitwarden will log out after 5 incorrect PIN unlock attempts. IF the attacker is guessing randomly (*), then with 4 digit PIN, they have 5/10,000 = 0.05% chance of success. With 6 digit PIN, 0.0005% chance of success.

(*) I realize you mentioned shoulder surfing as a concern, in that scenario the 5-incorrect-PIN-attempt-logout feature would not help,