Commerce Secretary Wilbur Ross. (Fabrice Coffrini/AFP/Getty Images)

MAJOR SHIFTS in international politics arise from complex historical processes, yet they can precipitate rapidly, as if by accident. A spasm of terrorist violence, a politician’s outburst — and suddenly institutions that had once seemed permanent no longer do. President Trump’s improvised announcement of stiff tariffs on steel and aluminum imports from the rest of the world Thursday feels like such a moment: The president’s national security rationale for the measures was so transparently spurious, and their likely economic impact so counterproductive, that he could have been acting only on an irresistible ideological impulse. And if all the carefully constructed institutions Mr. Trump’s words threatened — alliances between the United States and Europe, Japan and Korea; the global system of reciprocal free-trade law — are vulnerable to the whim of a U.S. president, how much substance, really, did they ever have?

We believe they do have substance; it consists largely of the commitments forged among men and women, over decades, across the Atlantic and the Pacific, determined to learn the lessons of the 20th century so as to prevent a repeat of its horrors. The U.S.-led postwar system laid the basis for peace and prosperity. Nevertheless, it’s on the defensive now, and those who would salvage it need to respond accordingly.

The saving grace of Mr. Trump’s chaotic leadership style is that it sometimes leaves room for backtracking. Mr. Trump says his tariff measures won’t be final for a week, which means there might still be time for damage control. The key is to exempt close treaty allies such as Canada, Japan, Korea and Germany from the new tariffs. Not only is there no national security risk from importing their steel and aluminum, there would also be national security harm from weakening them economically and alienating them diplomatically. And Commerce Secretary Wilbur Ross’s original proposal included a proviso allowing certain exemptions, based on “an overriding economic or security interest of the United States ” or, in the case of aluminum, on “their willingness to work with the United States to address global excess capacity.”

Responsible leaders, both within the United States and among our allies, can and should spend the coming days doing everything possible to take advantage of such loopholes. If the end result were a package of tariffs on steel and aluminum from China and Russia, that would be a more acceptable outcome, both in terms of targeting actual sources of oversupply and in terms of clarifying U.S. geopolitical commitments. U.S. imports from those two countries are so small that protectionist measures against them could send a message at a relatively low economic cost. However, Mr. Ross’s proposal noted that reducing tariffs on certain countries would require raising them on everyone else, and possibly taking other steps to prevent diversion of steel through unsanctioned countries, to achieve the same economic effect. That is indeed a problem, because selected American industries, not national security, are what Mr. Trump and Mr. Ross are actually trying to protect.

In short, any refinement of Mr. Trump’s tariff plan would be a distant second-best solution, and even that is unachievable unless Mr. Trump compromises on the ideological objective that motivated his outburst in the first place. Nevertheless, the stability of a fragile international system hangs on that faint hope.