How to protect authorized_keys file?

It's pretty common to simply remove write-access to that file if you're not planning to change it often.

This is also suggested by the Arch Linux wiki:

chmod 400 ~/.ssh/authorized_keys

Now, of course, that write access could be added back in by a malicious script, so you need to set the file and its parent directory to be immutable:

sudo chattr +i ~/.ssh/authorized_keys
sudo chattr +i ~/.ssh