The UN secretary general, António Guterres, sometimes shares a lesson from his late first wife, a psychoanalyst. If two people are in a room, there are actually six to consider: “What each person is; what each person thinks he or she is; and what each person thinks the other is … What is true for persons is true for groups, and countries.”

Given the limits of our knowledge, what matters are not only our intentions – and whether we have enough self-knowledge and discipline to reckon them – but also the other party’s assessment of them. In global affairs, when one or both assume too much, the consequences can be catastrophic. In 1983, America’s “Able Archer” war game brought the world to the brink of nuclear disaster without the US realising: amid heightened tensions, Moscow feared preparations for a real attack were under way. Even when intelligence to that effect fed back to Washington, the Reagan administration dismissed it as Soviet propaganda.

Those lessons from the couch and the cold war underscore the risks we face as the stand-off between the US and Iran intensifies. The crisis was created by the US attempt to destroy a nuclear deal that Iran has abided by, and to choke its economy, but has gathered pace with Tehran’s recent actions, including alleged attacks on oil tankers last week. Donald Trump tweeted on Friday, confirming overnight reports, that the US had been “cocked and loaded” for attacks on three sites in retaliation for the shooting down of a drone. He added that he called off the strike with only 10 minutes to go, having learned that 150 people would die.

Iranian officials have already claimed that the president sent a message via Oman that an attack was imminent but that he wanted talks, and was against any war. In retrospect, Mr Trump seemed to make a striking shift from Thursday morning’s apparent threat that “Iran made a very big mistake!” to his later suggestion that the downing of the drone was probably a genuine error, perhaps reflecting second thoughts and resentment at feeling railroaded by John Bolton and other advisers. But any reassurance at the president’s decision to override the hawks goading him should be tempered by the fact that the strike almost went ahead.

Both Iran and the US military, if not Mr Bolton or Mike Pompeo, are wary of fatalities on either side. Both sides believe they are taking calculated risks. Are they right? One danger is that Iran appears to believe it can exploit the obvious divisions, counting on the reluctance of a man who promised to keep his country out of costly foreign wars and has just launched his re-election bid. It seems to believe it has priced in Mr Trump’s short attention span and temper as well as his national security adviser’s scheming.

Another danger is that the US is counting on Iran feeling chastened by its near miss. Yet with its economy in such dire straits, Iran may be more willing to risk taking a limited hit if it thinks that is the only way to get what it ultimately wants. Though it exercises significant control over militias, it cannot totally rule out an unplanned action. And the lesson it takes from Thursday’s events may not be that it is under threat, but that the US won’t ultimately act upon its threats. Some wonder if Mr Trump truly intended to, or if the announcement of the called-off operation is part of his “maximum pressure” strategy.

The opportunity here is that Tehran may now feel it could come to the table with more dignity. But though Mr Trump keeps proffering talks, he has yet to explain what he might offer. Iran desperately needs a relaxation of the sanctions regime, perhaps through lighter enforcement or ad hoc waivers. There is no sign that the US is willing to shift. But allies should continue to make the case, including at this month’s G20 meeting in Osaka. Without de-escalation, the risks of mistakes, miscalculations and mutual misreadings will persist.