You’d think he’d get this one right. But you’d be wrong.

President Trump’s first stop on his European magical mystery tour was Poland, a staunch United States ally that bussed in thousands of ringers to make sure that the U.S. president was greeted with cheers and adulation. All he had to do was stick to a benign script, tick off the points about our support for Poland, smile, shake hands, and leave.

But he couldn’t do it.

Instead, he praised Poland’s increasingly authoritarian president, Andrzej Duda, as “an example to others who seek freedom,” and commiserated with him about the difficulty of dealing with a free press.

It’s always nice to say a few kind words about your host, but these words about this host are a shocking display of cluelessness. Duda, the leader of Poland’s right-wing Law and Justice Party, has recently cracked down on press freedoms, signed a law giving the government political control over state media outlets, taken control of the country’s judiciary, and cut back on women’s rights.

This is Trump’s idea of “an example to others who seek freedom.”

The press was not the only American institution Trump attacked while in Poland. He also took the opportunity to trash the U.S. intelligence community.

Trump started with his familiar refrain that “nobody really knows” for certain if Russia interfered in the 2016 election, even though the entire American intelligence community has made it clear that they do, in fact, know for certain that Russia was the culprit.

If Trump had only raised a question about a specific conclusion reached by American intelligence agencies, it would have been bad enough. But he didn’t stop there. Instead, he went out of his way to trash and undermine the credibility of American intelligence.

First, he justified his lack of confidence in our intelligence agencies by pointing out that the intelligence community got it wrong some 15 years ago when it determined that Saddam Hussein’s Iraq had weapons of mass destruction. They got it wrong then, so why should we trust them now?

Then he noted that, contrary to the fake news American press, it wasn’t 17 intelligence agencies that determined that Russia had interfered with the election with the specific purpose of helping to elect Trump. It was actually “only three or four” agencies.

Gosh, if it was only four American intelligence agencies that determined that Russia interfered, how could anybody take it seriously?

By the way, the “only” four agencies that determined that Russia had interfered with our election were the CIA, the FBI, the Director of National Intelligence, and the National Security Agency, the crown jewels of American intelligence. And while only these four agencies may have actively developed the facts around the Russian interference, the statement about Russian interference, released by Homeland Security and the Director of National Intelligence, was made on behalf of “the U.S. Intelligence Community,” which is made up of 17 agencies. Not one of those agencies has ever voiced an iota of disagreement with the statement that was made on their behalf.

In a sane world, with a sane President, one might ask “to what end is our President doing this?” But in Trumpworld, that question has been rendered impertinent. To what end? To no end. It’s just Trump blurting out whatever is bothering him at the moment.

Trump’s undermining the credibility of the American intelligence community on foreign soil is weird, clueless and profoundly harmful to America’s interests. It is the kind of thing we expect our adversaries to do. We would not tolerate it from a friend or ally. And nobody in his right mind would expect it to come from an American President. Except this one.

What happens the next time American intelligence turns up evidence of dangerous activity by an adversary? What happens, for instance, if the CIA obtains intelligence that North Korea is closer to developing a deliverable nuclear weapon than had been previously thought, and the U.S. seeks support and assistance from the rest of the world?

Will our allies question the reliability of the Trump administration’s intelligence? Will our enemies attack the credibility of the intelligence, citing Trump’s own words back at us?

Count on it.

Please follow Philip on Twitter at @PhilipRotner. Philip Rotner is a writer, attorney and an engaged citizen who has spent over 40 years practicing law. His views are his own and do not reflect the views of any organization with which he has been associated.