This is How You Lose the Time War by Amal El-Mohtar and Max Gladstone
Among the ashes of a dying world, an agent of the Commandant finds a letter. It reads: Burn before reading. Thus begins an unlikely correspondence between two rival agents hellbent on securing the best possible future for their warring factions. Now, what began as a taunt, a battlefield boast, grows into something more. Something epic. Something romantic. Something that could change the past and the future.
Except the discovery of their bond would mean death for each of them. There’s still a war going on, after all. And someone has to win that war.