Just as the Persian Gulf crisis was repairing gutted U.S.-Arab relations, Iraq has overreached with attacks on Iranian oil tankers that threaten a calamity: American loss of life that would be blamed on Baghdad by anti-Arab American politicians.

The avowed reason for Iraq's assault is to cut the massive flow of oil out of and money into Iran. In fact, Baghdad more likely is trying to boost Iraqi morale -- an attempt egged on by Saudi Arabian and Kuwaiti allies.

But this gives the appearance that Iraq has broken the cease-fire in the Gulf war called for by the United Nations, even though, in fact, it is Iran that has refused to accept it. Therein lies the potential disaster for President Reagan's Middle East policy and Arab relations. If it seems that Washington has lost its independence and is guided by decisions made in Baghdad, any loss of American life becomes intolerable.

''We are not about to stand still for Iraq or any other country to determine if, when or where the United States shall fight a war,'' an administration official told us. He fears resumption of Iraq's tanker attacks could bring the United States to the threshold of war with Iran.

That hardly seemed likely when the president decided to protect Kuwaiti tankers from being sunk by Iran in the Gulf's international waters. When the United States next asked the U.N. Security Council to end the Iran-Iraq war, seeds of crisis were planted. Iraq immediately accepted the cease-fire, but Iran has been stalling for six weeks and is not expected ever to say yes. During that time, Iranian oil shipments reached record levels as Iraq allowed tankers to pass peacefully through the Strait of Hormuz.

Both Saudi Arabia and Kuwait, acting out of fear and hatred of Iran and possibly a desire to draw the United States in more deeply, privately advised Iraq to go after Iranian tankers and end its unilateral cease-fire. Now, Iraq's resumption of the tanker war makes it look like the offender, even though Iran never has stopped bloody ground warfare.

Loss of American life in the Gulf would now be blamed on Iraq, fairly or not. If that happens, it could shatter the delicate U.S.-Arab alliance built out of the Persian Gulf crisis, after nearly six years of White House hostility to the Arabs.

Iraqi Ambassador Nizar Hamdoon leaves Washington this week to return to Baghdad as deputy foreign minister in an optimistic mood after four years of ups and downs. He told us in a CNN interview that Arabs have been left with the impression ''that America is moving to secure them from the Iranian policy of intimidation.'' That reflected Iraq's view that the United States has become irrevocably committed to an anti-Iranian, pro-Arab balance in the Gulf.

Officials here are surprised that even Prince Bandar, the sophisticated Saudi ambassador to the United States, seems to have underestimated the political sensitivity of Reagan's Persian Gulf policy. Bandar is said by diplomatic insiders to have been the unidentified Saudi spokesman in Jeddah last week who called for major escalation of anti-Iranian actions, with the West joining the Arab world.

But if that results in American bloodshed, the same politicians who six months ago blocked a Reagan-proposed arms sale to the Saudis will have a pretext for the United States to switch policies in the Gulf. It depends on Iran's reaction.

The Iranian government, U.S officials told us, has been deep in new ''contingency planning'' since the resumption of Iraqi air attacks. That may explain Iran's decision to fire a large, unidentified missile at a Kuwaiti container ship Monday. When the missile aborted, the ship was attacked by speedboat machine guns. There was no loss of life, but the Kuwaiti vessel put in at Dubai, far short of its destination.

Iranian fear of American retaliation could rule out any similar attack on an American ship. In that case, Tehran would rein in even the wild-eyed Revolutionary Guards who drive the Swedish-built speedboats, and the Iraqi gamble would be paid off in a demonstration of Iranian impotence.

Such a gamble might seem small for Iraq. But not for the United States, its policy in the Middle East and its relations with the Arab world -- which stir such deep emotions in American domestic politics.