“He’s an institutionalist, and he’s done some things well, starting with rejuvenating the State Department after Rex Tillerson dismantled so much,” Mr. Burns said, referring to the president’s first secretary of state. “But on policy, he has been the voice of unilateralism, of ‘our way or the highway.’ And he’s discovering, just recently, that the world is pushing back.”

This article is based on conversations with more than two dozen current and former American officials, foreign diplomats and policy advisers, most of whom agreed to discuss Mr. Pompeo on the condition of anonymity.

Sticking to Trump, While Rebuilding an Agency

John R. Bolton, the national security adviser, sometimes expresses his own views and tries to bend policy, as he did on Syria, when he said American troops would stay as long as Iran had troops on Syrian soil. Mr. Trump quickly quashed that thought.

By contrast, Mr. Pompeo unfailingly sticks to the presidential line. For example, he publicly refuses to acknowledge the intelligence agencies’ assessments — including those prepared by his former staff at the C.I.A. — that contradict Mr. Trump on matters like North Korea, Iran, Saudi Arabia and the Islamic State.

The president has rewarded Mr. Pompeo’s loyalty by anointing him the point person on several signature issues. Those include North Korea and Afghanistan, a subject on which one American official said Mr. Pompeo and Mr. Trump speak directly to each other, sidelining Mr. Bolton.

Mr. Pompeo, an evangelical Christian, also talks of global religious freedom as a priority.

The American foreign policy establishment is ambivalent toward Mr. Pompeo, praising him for reinvigorating the diplomatic corps while criticizing him for his policies and ideology.

After he took over the State Department last April, Mr. Pompeo promised to return “swagger” to the ranks, which had been depleted and demoralized under Mr. Tillerson. He resumed hiring young diplomats and appointed respected career officials to top positions. Still, many ambassadorships remain empty, which he blames on a Senate backlog.