Secretary of State Alexander M. Haig Jr. directed his official spokesman to confirm yesterday that he believes a longstanding "guerrilla campaign" has been waged against him by a top White House official.

The unusual announcement generated a new defense of Haig by President Reagan and a cascade of speculation about who is doing what to whom in the high ranks of the administration.

It was disclosed that Haig earlier had believed White House chief of staff James A. Baker III was his tormentor, but that Baker convinced Haig in a telephone conversation last week he was not leaking derogatory information about him.

Presidential national security adviser Richard V. Allen, the other prime suspect in most accounts of the internal strife, denied that he was the source of attacks on the secretary of state. "Bring on the polygraphs," Allen told reporters.

In an interview, Allen elaborated, saying: "Haig called me this afternoon and told me he knows it's not me. I know it's not Allen; Haig knows it's not Allen."

The latest imbroglio among the policy-makers began with a syndicated column sent to client newspapers early last week by Jack Anderson reporting that Haig is the top name on Reagan's "disappointment list." According to Anderson, "the secretary of state reportedly has one foot on a banana peel and could skid right out of the Cabinet before summer."

Quoting unnamed White House sources, Anderson also wrote that Reagan "has lost confidence" in Haig's judgment and that "there is something about the man that tends to raise the hair on the back of the president's neck."

Last Saturday afternoon, White House communications director David Gergen obtained an advance copy of the Anderson column, which was scheduled for newspaper publication yesterday. After checking with Baker, Gergen called the columnist to say that the president retains confidence in the secretary of state and had repeatedly and recently said so.

According to Gergen, he asked for "a disclaimer" in the column stating official White House views, and then telephoned Haig with news of the impending report.

Haig called Anderson twice during the course of the day to discuss and rebut the column. Anderson yesterday said Haig had told him he knew who was leaking the attacks but would not name the person.

Anderson said that he informed an "angry and upset" Haig that his sources were very high officials and that one of them had discussed the matter with Reagan.

At that point, Haig telephoned the president at Camp David. Reagan, in turn, called Anderson to tell him that the column was wrong and that he is "very pleased with Al Haig and what he has done."

All this high-level refutation was the subject for a new Anderson column, published yesterday in The Washington Post and other newspapers in place of the original report.

In the new version, Anderson quoted Haig as saying in indirect discourse that the attack on him "was obviously the handiwork of a top White House aide, who has been running a guerrilla campaign against him for nine months." Haig was also quoted as calling the campaign against him "just mind-boggling" and "sabotage of the president" by some of his own people.

Haig's State Department spokesman, Dean Fischer, confirmed officially yesterday that these quotations from Haig in the Anderson column were accurate, and that Haig believes them to describe the situation he is in.

Fischer said the internecine warfare is "not helpful" in operating the nation's foreign policy. Reagan, in an exchange with reporters at the White House, went further, saying that the reports of disarray are "very destructive to our dealings worldwide."

"The only thing I can figure out about stopping the backbiting is convincing all of you that there is absolutely no foundation to any of these rumors that keep getting so much circulation," said Reagan.

The president called Haig "a good secretary of state . . . the best we've had in a long time."

Reagan seemed to express doubt that a staff member of his was behind the sniping, saying, "Sometimes I wonder if there is such a thing as an unnamed source."

Fischer refused to identify the "top White House aide" who Haig believes has been leading the attack on him. But a senior administration official said Haig has felt for some time that chief of staff Baker was leading a quiet campaign to discredit him.

Haig confronted Baker with these accusations last week, both Haig and Baker confirmed in interviews. But both said that after they had discussed the matter by telephone, with Baker telling Haig that he was not leaking derogatory information about him, Haig came to believe he had been mistaken.

What prompted Haig's call to Baker last week was a newspaper column and television network report--which were promptly denied by the president--that Haig would be leaving his State Department job as part of a shake-up of the Reagan foreign policy hierarchy.

The matter was first surfaced publicly by syndicated columnist Joseph Kraft, who termed the account a "rumor" in his column, and was then aired as a confirmed account by the CBS network's Bob Schieffer.

"Last week, Secretary Haig had the idea that I was behind it," Baker acknowledged. But he said he told the secretary at length that this was not the case. Now, added Baker, "Haig has told me and presidential counselor Edwin Meese and others that he does not think that I'm behind any effort to get him."

Said Haig: "I had talked to him Baker about that story." Asked if Baker had reassurred him, the secretary said: "He did . . . I don't for a moment believe it is Jim Baker. I don't know who it is."

Another official who has been the object of Haig's suspicion is White House staff secretary Richard G. Darman, according to a source close to Haig. Darman last night denied "totally" that he had ever leaked any derogatory information about Haig.

Yesterday's swirl was but the latest chapter in a serial of feuding and friction that has marked the Reagan administration's foreign affairs hierarchy since Inauguration Day. The disputes, at times occurring publicly, seemed to be personal infighting rather than struggles over ideology.

At various times, the combative Haig has had bureacratic run-ins with virtually all of the top officials of the national security hierarchy, and with a number of domestic policy officials as well.

Problems between Baker and Haig first surfaced, in fact, shortly after Inauguration Day, when Baker objected to Haig's initial proposed draft of a memorandum for setting up a national security policy structure. That memo (a national security presidential decision memorandum) would have defined all international economic policy as foreign policy, thus placing the secretary of state in charge of all such policy-making.

Baker believes that his intervention back then was at the root of Haig's suspicions last week, White House sources said.

But most prominent among the antagonists have been Haig and the president's national security adviser, Allen. Tensions between them still run high, according to officials in both the White House and State Department.

While this has been a matter of grave concern to a number of policy-makers, until the last few days it has apparently not been a matter that the president felt called upon to personally resolve once and for all. This, too, has troubled a number of top administration officials.

"It is just not Ronald Reagan's style to call Haig and Allen together into a room and tell them to end the hostilities," said one administration official. But he made it clear he believed this is what Reagan should have done long ago.

He and others also said that they blame presidential counselor Meese, who is in charge of coordinating the efforts of Haig, Allen, Defense Secretary Caspar W. Weinberger and others. In this view, Meese should have headed off the infighting long ago and pressed Reagan to forcefully intervene.

The extent of the problems between Haig and Allen was demonstrated not long ago when the secretary of state became extremely upset upon hearing that Baker had arranged for Allen to conduct a background briefing for reporters in advance of the Cancun summit. Haig reportedly complained to the White House and the briefing plan was changed; Haig and Treasury Secretary Donald T. Regan conducted the briefing.

Also, at a recent National Security Council meeting on East-West trade policy, as the president sat listening, Haig charged that Allen had changed the wording of some of the four options that were to be discussed, according to a participant.

The president asked his aides to get their policies together and present them when they were prepared. Later, Allen maintained that the wording of the options had not been changed at all, but that the options had only been retyped.

On occasion, Haig has bypassed the normal channel of sending policy papers to the White House through the national security adviser, according to White House and State Department sources. He has instead sent some directly through Meese and routed still others through additional channels.

Allen has taken the philosophic view that these Haig communications were merely "misaddressed."

The same sources said Allen is also being bypassed in some policy channels. State Department, Defense Department and Central Intelligence Agency officials have been meeting to study policy alternatives on how to deal with Cuban military support for rebels in Latin America. But no member from the NSC staff has attended the sessions.

The task force was established, sources said, by Deputy Secretary of State William P. Clark, who has his own personal channel to the White House, via his longtime friend and fellow-Californian, deputy chief of staff Michael K. Deaver.