FOR THREE DECADES, American policy in the Middle East has combined the often contradictory goals of safeguarding Israel while maintaining credibility as a friend to the Arab world. Since Menachem Begin became Israel's prime minister, this two-pronged policy has become increasingly difficult to pursue.

Begin's actions have forced stark choices on Washington -- choices that have led both to growing acerbity in Israeli-American relations and declining U.S. credibility among the Arabs. In this harsh atmosphere, President Reagan's peace initiative has thus far made little progress.

Now, two unpublished letters bearing the signature of Philip C. Habib, President Reagan's special negotiator in Lebanon, reveal another powerful blow delivered by the Israelis to American credibility in the Middle East.

The letters, written last August, contain American commitments to the Palestine Liberation Organization that were based on assurances provided to Habib by the Israeli government. These commitments were crucial to the PLO's agreement to evacuate Beirut.

When the Israeli government, after the evacuation, reneged on its assurances, the United States was left powerless to respond. The State Department acknowledges that the failure to keep the commitments to the PLO has undermined American credibility in the Arab world, presumably weakening the prospects of success for President Reagan's peace initiative.

The Habib letters were part of the lengthy negotiations he conducted last summer to get the PLO to withdraw peacefully from Beirut and thereby remove any reason for Israeli occupation of the city. Israel concurred in the negotiations.

The PLO's negotiating team, led by Yasser Arafat, repeatedly stated that among its conditions was a guarantee of the safety of the Palestinian population left behind in the refugee camps. It was no secret that Palestinians in Lebanon, foreseeing the end of PLO protection, feared the vengeance of the Christian Phalange.

To satisfy the American policy of not dealing with the PLO, Habib never negotiated with Arafat directly. The bargaining went on through verbal query and written memoranda, but passing always through intermediaries, usually Lebanese. These exchanges persuaded Habib that the Palestinians' concerns were well founded, and American diplomats proceeded to raise them on the PLO's behalf during talks with Begin, as well as with Bashir Gemayel, the Phalange's leader.

Upon Begin's answers, which Gemayel endorsed, Habib staked the good name of the United States. In the published plan of evacuation, to which all of the parties subscribed, a provision in the section of "Safeguards" says, "The United States will provide its guarantees on the basis of assurances received from the Government of Israel (GOI) and from the leadership of certain groups with which it has been in touch."

Habib's own letter, addressed to the Lebanese prime minister to circumvent the ban on dealing with Arafat, is more explicit. Published here for the first time, it warrants as follows:

"With reference to our many discussions . . . I am pleased to inform you that the government of Israel has assured the United States government that the plan for the departure of the PLO is acceptable. . . . On the basis of these assurances, the United States government is confident that the government of Israel will not interfere with the implementation of this plan for the departure from Lebanon of the PLO leadership, offices and combatants in a manner which will:

"(A) Assure the safety of such departing personnel;

"(B) Assure the safety of other persons in the area. . . .

"I would also like to assure you that the United States government fully recognizes the importance of these assurances from the government of Israel and that my government will do its utmost to ensure that these assurances are scrupulously observed."

Then on Sept. 14, Bashir Gemayel was assassinated and the Israeli army rushed into Beirut. The State Department maintains that the assassination in no way relieved the Israeli government of the pledge it gave Habib to stay out of the city, but the American government raised only mild objections to the occupation.

The following day the Israeli army authorized the Phalangists to enter the Sabra and Shatila refugee camps, presumably in search of terrorists. The massacre that ensued realized the worst forebodings of the PLO negotiators. The exact number of dead, including women and children, is impossible to determine, but the range is in the many hundreds.

Morris Draper, the deputy assistant secretary of state for the Middle East and Habib's associate in the negotiations, is said to have warned Israeli officials on the eve of the massacres against allowing the Phalangists into the camps. Bruce Kasldan, the Israeli foreign ministry representative in Beirut, made this assertion to the official commission inquiring into the killings, and the State Department said his statement was consistent with American policy.

In an interview with Washington Post correspondent Loren Jenkins in Tunisia in November, Arafat said, "We put our trust in the United States as a superpower to keep its word. But what happened is shameful." Arafat said the American failure to stand by its word raised doubts about the value of any commitments it might make in future peace negotiations.

I raised the question of American responsibility for the events in Beirut with Charles Hill, who this summer served in Draper's post in the State Department, while functioning as laison with Habib and the U.S. delegation in Beirut. A few weeks ago, Hill was promoted by Secretary of State George Shultz to executive secretary, one of the highest posts in the department.

"Legally, we did not violate our commitment to the PLO," Hill said. "We had not made the commitment on our own. We said we had assurances from others and, without our own armed forces in the area at the time, we had no way to enforce our own commitment. We said to the PLO only that we were convinced that others would keep the commitment made to us.

"The PLO's decision to evacuate Beirut was contingent on our word, however. The sequence would have unfolded differently without it. When the news came out about Sabra and Shatila, Begin said it was a blood libel to hold Israel responsible. But here in this building we felt that we had a responsibility for what happened. Morally, we let them down."

Hill said that throughout the negotiations with Habib, PLO representatives expressed apprehensions that Israel would slaughter their women and children, or allow them to be slaughtered. He said the American side never imagined that either contingency was possible, because they were confident the Israelis would not do the slaughtering, and the Israelis were not expected to be in Beirut to allow others to do it. But when the Israelis seized the pretext of Gemayel's assassination to seize Beirut, the stage was set.

"Even then," Hill said, "we were not unduly concerned, because the Israeli prime minister told us his forces entered Beirut to prevent slaughter, and we believed him. The Israelis said they were entering Beirut in a humanitarian capacity. After they got there, it became obvious to us that their designs went far beyond humanitarianism.

"The United States lost a great deal of credibility that weekend. We still have some left. But we lost a great deal."

Hill pointed out that the United States, though it conveyed its displeasure to Israel, never formally lodged a protest, either for the occupation of Beirut or for what happened at Shatila and Sabra. Shortly afterward, the Israeli commission to inquire into the massacres was established, he said, and it seemed best then to let events take their own course.

The other Habib letter concerns Palestinian prisoners, as well as prisoners of ouranther nationalities, who were taken by the Israeli army in Lebanon after the invasion began. This letter is less precise than the letter on withdrawal in the obligations it imposes on the United States. Furthermore, the Arab world has chosen thus far not to press the issue of the Palestinian prisoners. But American officials acknowledge, nonetheless, that very little has been done to follow up on the letter's pledges.

In part, the letter states:

"The United States government will continue to discuss with the government of Israel the conditions under which such persons are detained, reflecting the view of the United States government that they should be accorded the most reasonable, humane and orderly treatment possible under the circumstances. They should be dealt with in a manner consistent with international obligations and should be treated in a way which respects humanitarian considerations."

The PLO claims there are 12,000 to 15,000 prisoners, not all of them Palestinian, in Israeli hands. The International Red Cross, through a spokesman in Geneva, said it had located 6,000 to 7,000 in Lebanon, and the Israeli government announced after the fighting last August that it held about 8,000 more in Israel. So the PLO figure appears roughly correct.

Shortly after the invasion of Lebanon, the Israeli government said it considered PLO fighters to be "terrorists," and therefore not covered by the Geneva convention, although it pledged to treat prisoners under standards fixed by the Geneva convention. The Israelis added, however, that since PLO membership is a crime under Israeli law, some of the prisoners could be tried.

In the three months since the end of combat, no trials have been announced. But the Israeli government, which notes that there are about a dozen Israelis in PLO and Syrian hands, has been unwilling to discuss the prisoners and says it has no plans to release them. An Israeli spokesman here said release would be part of an arrangement on withdrawal of all foreign forces from Lebanon.

Speaking in Geneva, a Red Cross spokesman said that Israeli authorities, observing the convention, permit Red Cross visits of Ansar, the major Lebanese camp, though the spokesman declined, as a matter of policy, to comment on conditions there. He added, however, that the Israelis have permitted no visits of facilities in Israel, and otherwise decline to cooperate with the Red Cross, so it has no idea of what is happening there.

At the State Department, an official said that the United States, which holds that the prisoners are covered by the convention, repeatedly expressed its concerns to the Israeli government. But he acknowledged that the prisoners, notwithstanding the Habib letter, are a subject that gets little attention at the department, and he could not cite any specific American intercession in their behalf.

The Habib letters have emerged in recent weeks as a controversial item at the State Department. The position taken at the highest level is that release of the letters, though they deal with an American commitment, might be interpreted as an intrusion into Israel's politics, where the question of Israeli responsibility has provoked a highly charged national debate, as well as calling forth the official inquiry.

More than that, the letters have become a focal point in the contest being waged not only within the State Department but within the White House over the proper and most effective American posture for dealing with the Begin government.

The contest pits a "gentle persuasion" school against a "hard line" school, and the letters have become a test of whether the United States will mollify or confront the Begin government when Israeli actions challenge established American policy.

President Reagan will of course decide theecontest, but it is generally agreed that the future of his program for a Middle East peace settlement may depend on which school he allows to dominate American policy toward Israel.

From the beginning of his administration, it has been apparent to most observers that Reagan favored the "gentle persuasion" approach. But lately the word coming from the White House, and from high-level diplomats, is that the president has shifted.

Sensitive to the charge of being frivolous in Middle East matters, if not an actual partisan of Israeli hawks, Reagan is said to be planning to introduce his new attitude to the Israeli prime minister at their next meeting. The meeting, once postponed, will take place in Washington in January.