Thanks to info provided by the fine folks at Smile Software, you can use the Terminal command:
ioreg -l -w 0 | grep SecureInput
That will tell you the process ID (kCGSSessionSecureInputPID) of the application that has Secure Input enabled. You can then use:
ps auxww | grep NNN
to find the process with the specified pid.
I will endeavour to add some support for this within Keyboard Maestro’s alert in the future.
Thanks again to the Smile Software, makers of great Mac software!