President Donald Trump could have used his maiden speech at the United Nations Tuesday to reassure allies he was capable of providing global leadership against 21st century threats.

Instead, he delivered a bombastic stump speech about guarding American sovereignty that was more suited to his faithful than to world leaders. He peppered his mainly isolationist remarks with a dash of religious sermonizing (to please evangelicals?) and several nods to traditional Republican rhetoric and even regime-change neocons.

The result was a mishmash rife with contradictions — rather than the new foreign policy doctrine of "principled realism" his aides had promised.

Even more disturbing was Trump's use of inflammatory bluster against North Korea and Iran that failed to disguise the absence of coherent policy on either. This raises the prospect America will soon face two nuclear crises, and possibly two new wars.

The internal contradictions in this speech revealed the hole in the center of American foreign policy: a Trump team that holds starkly different worldviews. Previous presidential teams have argued within but previous presidents have normally resolved those differences and put their own stamp on the product. Trump, however, veers back and forth like a metronome, and is often impervious to advisers.

The result makes for incoherent speeches and incoherent policy. With no clear vision or direction from the top, chaos reigns.

That confusion was evident on the U.N. podium. The lead writer of the speech was reportedly the young, uber-nationalist, anti-immigrant Stephen Miller, who channels Trump's most basic isolationist instincts.

So Trump stressed America First over and over, insisting he was "renewing this founding principle of sovereignty" as the basis of American foreign policy. Never did he commend any benefits of collective action.

Indeed, the president used the word sovereignty more than 20 times, reviving his constant complaint that the world, and the United Nations, were taking advantage of America. The stress on sovereignty was a sop to his alt-right base, some of whom believe that U.N. bureaucrats (in black helicopters), along with international organizations, were on the verge of taking control of our country.

But for Trump, the sacredness of sovereign borders seems to apply mainly to America and whomever he favors at the moment, including certain authoritarian regimes.

The president never mentioned Russia's violation of U.S. sovereignty by interfering in our elections or its invasion of Ukraine. (He did make a brief reference to respecting the borders of "the Ukraine," a term not used since Ukraine was part of the Soviet Union.) His brief reference to threats to the sovereignty of the South China Sea never mentioned China's military buildup there.

Trump's reverence for sovereignty disappeared, however, when it came to Iran, North Korea, Venezuela and Cuba, where he came close to advocating regime change (a neocon approach that had disastrous results in Iraq and which Trump has previously rejected).

Trump's sovereignty mantra is taking him down a dangerous path when it comes to North Korea and Iran.

Perhaps the president thought he could scare Kim Jong Un when he proclaimed that the United States, if "forced to defend itself or its allies," would "totally destroy North Korea."

Trump's talk about mass destruction — without first consulting Asian allies — will only undercut Asian solidarity against Pyongyang and goad Kim to respond in kind.

As for Iran, yes the nuclear treaty is imperfect, but it prevents Tehran from building nuclear weapons for at least a decade. To abandon it now would free Iran to march straight to a bomb unless Washington wanted to go to war. Nor would the other signatories to the pact — the European allies, as well as Russia and China — go along with a unilateral U.S. exit.

What Washington needs now, in standing up to North Korea, Iran and Russia, is a coherent foreign policy of tough, behind-the-scenes diplomacy that works with friends and allies on further isolating Pyongyang, while enforcing the Iran deal and curbing Tehran's behavior in the Mideast. And it needs a president who can make American firmness clear to the world.

Instead, we have a president who confuses rhetoric with policy, and disdains diplomacy in favor of chest-beating. That's what was clear on Tuesday as we watched Trump perform.

Trudy Rubin is a columnist and editorial-board member for the Philadelphia Inquirer.