During his final term as Federal Reserve chairman, Alan Greenspan noted an impediment stifling economies in the former Soviet Union: "legal chaos, rampant criminality, and widespread corruption" reminiscent of the American Wild West.

"Market economies," Greenspan concluded, "require a rule of law."

Suddenly, the words and actions of President Donald Trump are raising questions about that principle here. After attacking the judiciary over his travel ban earlier this year and firing the FBI director investigating his campaign, the president has warned Special Counsel Robert Mueller about his inquiry, ripped his own attorney general and mused about issuing pre-emptive pardons.

There's no sign of direct economic consequences yet, but as he strains the justice system at home and upends American commitments abroad, Trump poses two kinds of risks.

One is to investor confidence in the United States. So far, booming markets have shrugged off momentary sensations, such as the disclosure that his son and campaign chairman sought information to damage Hillary Clinton from a Russian lawyer and Russian spy.

"The right trade has been to ignore political developments," said Mohamed El-Erian, chief economist for Allianz. But El-Erian warns that "a major shock" could rattle that trade.

Whether Trump himself could administer that shock — say, by firing Mueller and ending the Russia investigation altogether — would depend on how the Republican-controlled Congress reacts. Lawmakers could accept those actions, or challenge a president of their party.

The other risk is to benefits America derives from its status as the world's economic leader. Trump has already unsettled leaders of other advanced economies by casting doubt on the nation's international commitments.

The steadiness of the American political system is what has kept the dollar the world's reserve currency throughout the post World War II era and kept the U.S. the most consistent safe haven for global investment. That, in turn, has assured American businesses ready access to capital, and the federal government an entree to inexpensive financing of budget deficits.

"Most international observers I've encountered are deeply concerned by Trump's lack of interest in — or even disdain for — the 70-year-old international system that the U.S. led in creating and then adapting," said Robert Zoellick, who served both Presidents Bush in roles including deputy White House chief of staff, deputy secretary of State, and U.S. trade representative before spending five years as president of the World Bank.

Nor are such concerns limited to observers abroad. Zoellick noted that the American president "has now assaulted courts, the intelligence agencies, and the Department of Justice," among others.

"Maybe the military is safe, at least with [Defense Secretary James] Mattis," he concluded. "The core question for America-watchers abroad, and I think for Americans, is how the American system and society cope with Trump."

An erosion of that asset would open opportunities for other economic powers to take advantage. One of them is China, which aims to fill the void created by Trump's abandonment of the Trans-Pacific Partnership.

It's not clear that any other nation has the ability or willingness to embrace America's traditional role as international problem-solver of last resort on challenges including security, public health or humanitarian relief. That, in turn, could impose costs on Americans by damaging the global economy.

One near-term test will be the president's willingness and ability to work with Congress to deliver an increase in the federal debt limit later this year. Failing to do so could imperil the unique credit-worthiness the U.S. enjoys.

Congressional Republicans have displayed a reluctance to take that step, and the White House lacks a clear strategy. Trump's own budget director has asserted that the administration can prioritize debt payments in a crisis.

"The impression abroad is that the U.S. is less dependable," El-Erian said. "What you're seeing is an erosion of the trust that underpins the multilateral system."

The threats Trump has signaled to traditional notions of the rule of law represent the other side of the same coin. As new evidence emerged over the weekend about the Trump campaign's interactions with representatives of Russia, the president asserted via Twitter to his "complete power to pardon."

@realDonaldTrump While all agree the U. S. President has the complete power to pardon, why think of that when only crime so far is LEAKS against us.FAKE NEWS

"He sees 'loyalty' as a personal matter — not to American institutions, rule of law, the Constitution, and traditions," Zoellick said. "The U.S. presidents I've known, or read about, viewed the presidency as larger than themselves. I don't believe Trump does."