To check if an ssh key has passphrase, one can look for the presence of ENCRYPTED string in the private key. Here is an example
$ grep ENCRYPTED ~/id_rsa Proc-Type: 4,ENCRYPTED
In case ENCRYPTED string is present, the key is encrypted and will need a passphrase during use.