You can use Touch ID for sudo
I got tired of typing my password every time I ran my agents ran sudo, so I switched it to Touch ID. Now a small prompt shows up. You can set this up in about a minute.

Turning it on
sudo asks PAM (the pluggable authentication modules macOS inherited from Unix) whether you are who you say you are. Apple ships a PAM module called pam_tid.so that asks the fingerprint sensor instead. Since macOS Sonoma there's a config file for local changes that survives system updates, and Apple even provides a template for it with the right line commented out:
sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
sudo nano /etc/pam.d/sudo_local
Remove the # in front of this line and save:
auth sufficient pam_tid.so
sufficient means a matching fingerprint is enough by itself. If you cancel the prompt, sudo falls back to asking for your password like before, so you can't lock yourself out with this. Open a new terminal and run sudo -v to try it.
My version
The stock module has one catch. macOS stops offering Touch ID in these prompts while anything is capturing the screen, and my DisplayLink dock captures the screen all the time. Screen sharing and screen recording trigger it too.
So I my agent wrote a small PAM module that asks for the fingerprint through Apple's LocalAuthentication API directly, which keeps working while the screen is captured. Since it draws its own prompt, it can also say who is asking and show the full command.
The source code, install steps and notes on how I tracked down the screen capture problem are in the macos-touchid-sudo skill in my skills repository.
I wrote the module about two months ago and have used it every day since without any issues. I put it in the skills repository so I could set it up on my other two MacBooks, and it works just as well on those.
