on Windows the UAC (GUI sudo equivalent) requires actual user input (keyboard, mouse) on a dialog presented in a secure way (can't be faked by malware)
Psst. There's also this, in typical KDE style: https://github.com/aeroshell-desktop/uac-polkit-agent