Diplomacy/Alliance declared as an actual in-game setting
Rather than just doing "verbal" diplomacy/alliance agreements, make it an actual option in the game. If two (or more) players agree to diplomacy for a number of turns or indefinitely, one invites the other and if the other agrees, game does not allow them to attack each other. If one player decides to break the diplomacy, it would notify the other. Would end backstabbing. There would have to be a 1 turn delay so you couldn't just end diplomacy and attack in same turn... but you could in next turn. People could still do verbal if that was the format (or agreement) they wanted.
This already exists in the form of a mod. Check out one of the (many) diplomacy mods.
See https://www.warzone.com/wiki/Feedback for an explanation of why ideas that already exist as mods aren’t appropriate for this forum.