An FBI agent who led a double life in an alleged Mafia family for an unprecedented 6 1/2 years will be the key witness at an upcoming murder conspiracy trial in New York.

Despite reports of death threats against him by reputed organized crime figures and a government request that he testify anonymously, the trial judge has ruled that must use his real name in the courtroom.

The government considered the agent's undercover role as Donnie Brasco so sensitive and his safety so imperiled, that he and his family are under 24-hour guard.

The FBI says the New York investigation is without parallel in its fight against organized crime. Agents have infiltrated alleged La Cosa Nostra families before in recent years, but none has been been undercover as long or gotten as close to their leaders as Brasco. His underworld associates were so convinced of his assumed identity that they were ready to let him become a member of the Bonanno crime family.

His investigation spread to Tampa and Milwaukee and has resulted in the indictment of reputed Milwaukee mob boss Frank P. Balistrieri.

A New York trial judge ruled late last month that Brasco and another undercover agent known as Anthony Rossi have to use their real names in court because the defendants' right to a fair trial outweighed the danger to them.

Government documents filed in the case claim that during the investigation Brasco was so trusted by Dominick (Sonny Black) Napolitano, a reputed captain in the Bonanno crime family, that he was made part of gambling and loan-sharking operations and was instructed to go to Florida to pursue a rival who had escaped a murder plot.

As a result of the investigation, Napolitano and several co-defendants are charged with racketeering and conspiracy in the alleged gangland slayings of three members of a rival faction of the Bonanno family last year. All but Napolitano, who has disappeared, are scheduled to go on trial next week.

The FBI said one of the defendants, Benjamin (Lefty) Ruggiero, has threatened Brasco. An affidavit said that as recently as March, Ruggiero was overheard by an informant saying of the undercover agent, "We know where to find the S.O.B. We're going to get somebody to whack him." Ruggiero's attorney, Robert Koppelman, said yesterday that his client denies threatening Brasco.

In a May 19 affidavit, Jules J. Bonavolanta, assistant chief of the FBI's organized crime section, said the ability of Brasco and Rossi "to get as close as they did to high-ranking members of La Cosa Nostra has also resulted in severe embarrassment to some, if not all, 'bosses' and members of La Cosa Nostra."

He said that in an effort to head off threats against the undercover agents, the FBI decided to "personally advise" the defendants and the bosses of their families that the men were FBI agents, not "informants" or "stool pigeons," under the theory that underworld figures would be less likely to try to harm them.

The threats came anyway, Bonavolanta said. "Apparently the embarrassment of having been so deeply infiltrated by an FBI agent and having such infiltration result in additional infiltration by another FBI agent, has created a situation which La Cosa Nostra, by its very nature and history, cannot tolerate," he said.

In another affidavit, agent Jerry Loar said an informant heard Ruggiero say last August "that he was going to find and kill the FBI agent known as 'Donnie' if it was the last thing he did."

The defendant, who prosecutors have said is the target of a murder contract himself, also allegedly boasted that he had contacts in Miami area hotels who could get phone records of Brasco's visits there. Pictures of the agent also were being circulated in organized crime circles in an attempt to locate him, Loar said.

In his June 25 ruling, U.S. District Court Judge Robert W. Sweet said, "There can be no question but that these agents were, are and will be at risk. Certainly their performance as set forth by the government establishes their courage, heroism and skill as front-line fighters in the war against crime and entitles them to every appropriate protection."

The judge said he would keep information about the agents' addresses and families secret. But he required they be identified so the defense could cross-examine them fully and so the jury would not think their identities were hidden because of threats.

Records in the case give this description of Brasco's double life:

He has known Ruggiero since 1977, and through him, met Napolitano and became a member of his "crew." He traveled to Florida and Milwaukee with Ruggiero, and in Wisconsin in the late 1970s helped other FBI undercover agents set up a vending machine company.

Ruggiero, according to the Balistrieri indictment, told an agent using the name Anthony Conte that the vending machine business was controlled by the "mob." Balistrieri allegedly threatened Conte and demanded a half-interest.

Back in New York last summer, Brasco was told by Ruggiero that a rivalry in the Bonanno family had split its captains into factions, and that Napolitano and another captain had gotten permission from the Mafia bosses' "commission" in New York to kill several rivals. Three of the alleged Mafia members disappeared in early May, 1981, and the body of one, Alphonse (Sonny Red) Indelicato, was found a few weeks later in Queens.

In late July last year, Napolitano told undercover agent Brasco that he should go to Miami and try to find Anthony Indelicato, who had escaped the plot. A short time later the FBI pulled Brasco out of his role and told the alleged mobsters that their longtime friend was an FBI agent.