More about this type of scenario
https://time.com/6988935/trump-worries-ai-deepfakes-trigger-...
It would be hard to implement.
Both sides would basically need to agree, if we are attacking you, we will tell you via this protocol to prevent accidentally blowing the planet.