Deepening doubts in the shah's government about true U.S. intentions toward Iran reached a crisis point last Friday, forcing President Carter to send a confidential message to beleaguered Shah Mohammad Reza Pahlavi.

Carter's message, telephoned to the shah himself by presidential adviser Zbigniew Brzezinski, for the first time spelled out U.S. policy: Do whatever you feel you must to restore authority and stability, Brzezinski said; whatever that is, we are 100 percent behind you.

That message, long overdue, swept aside previous protestions about human rights, liberalization and civil liberties that have been pouring from the State Department for months as the shah battled to keep his country from deserting the West. Indeed, the president's message to the shah is a belated signal of a return by the United States to foreign-policy fundamentals swept away in post-Vietnam guilt.

Descent close to anarchy in the country that keeps Japan, Western Europe and Israel supplies with oil might yet prove to have a beneficial side. A crisis that one knowledgeable official here describes as "an event of the greatest magnitude" has startled presidential aides. They are now entertaining bitter second thoughts about the demise of the Central Intelligence Agency, the overuse of human rights to determine U.S. policy and obsessive fear of using American power.

Just a few weeks ago, a routine request by the shah's government for less than $100,000 of riot-control gear, including tear gas, was automatically rejected by the burgeoning human-rights bureaucracy at the State Department. An appeal was taken by the Iranian embassy all the way up to Deputy Secretary of State Lucy Benson before the equipment was approved for sale. That is merely icing on the cake of the administration's human-rights policies, which have endangered U.S. relations with its allies all over the world.

More important is gradual extinction of the CIA's ability to engage in covert activitiy. Officials here make no claims that even at its operational peak 20 years ago, the CIA could have played a decisive role in today Iran. But the currently weakened agency guarantees that the United States can do nothing to blunt immense Soviet undercover resources now operating without restraint throughout Iran.

The Soviet hand is evident in the carefully co-ordinated escalation of political demands not only by Moslem fundamentalists and left-wing radicals but also by the shah's presumed allies, the new middle class. This requires agents and money, both available in immense quantities.

A sure signal of the anxiety now gripping the White House was a private appeal for assistance last week to ex-CIA Director Richard Helms, a former ambassador to Iran treated as an untouchable by the Carter administration until now. Helms refused to admit to us that he had even been invited to the White House or to reveal what he said, but the summons points to a change of mood in the Carter White House.

That change of mood is also reflected by the private reaction among high administration officials to a seemingly routine decision by Pakistan to transfer its top diplomat from Washington to Moscow. The switch of ambassador Yakub Khan is a direct result of Pakistan's fear that the Soviet Union is now superseding the United States in political influence over countries that, like Iran, flank the southern border of the Soviet Union.

This directly results from the Russian-engineered coups in Afghanistan and South Yemen, without any U.S. reply. Simultaneously, the Cubans have been used as advance Soviet agents throughout Africa, again with no U.S. response.

Compared with Iran, these Soviet successes are small potatoes. But they have established a psychology of success for Moscow with damaging implications to the United States, setting the stage for the climactic events in Iran.

Ironically, it has taken Iran - the first real foreign crisis for Carter - to force hard thinking about the cost of politically appealing slogans on which the president has based so much of his foreign policy. In particular, the application of human-rights standards to U.S. allies and the continued defamation of the CIA are subject to news and realistic scrutiny.

Jimmy Carter has proved to be a good learner in other aspects of his presidency. There is solid reason to believe that the lesson of Iran is now being learned, and not a moment too soon.