The next best thing is to try to slow down how fast the destruction unfolds.
There was actually an incident where NORAD's terminals lit up with a full scale nuclear attack from Russia. They only had a few minutes to determine whether or not to launch a counter-attack. During that time they found out somebody left a training tape on the "production system" and fortunately it ended there. https://nsarchive.gwu.edu/briefing-book/nuclear-vault/2020-0...
The world got lucky on that day. In my mind this incident is the same as the "configuration management errors" we see take down huge websites. It's just a matter of time.
My proposal would look something like at traditional arms treaty with limits to the size and number of warheads, but I'd also add to that a time dimension. Maybe we agree to allow 10's of weapons that can be deployed in minutes, then there's another tranche of 100's of weapons that take more time to prepare... perhaps it takes hours to deploy them, or days. This would give people more time to determine if the threat is real and possibly let cooler heads prevail.
I have no idea how that would be enforced and how nations would prevent other nations from having a secret stash of deployed nuclear weapons.