A federal judge yesterday ordered ABC News to divulge the name of a confidential informant who told network journalists they had been secretly taped during an August 1980 visit to the U.S. marshals' headquarters in Northern Virginia.

U.S. District Judge Albert V. Bryan Jr. also directed government attorneys to turn over three original U.S. marshals' tape recordings to ABC for examination and testing by a private New York electronics expert. ABC has said in court papers it believes the tapes may have been partially erased or altered.

Yesterday's rulings, in U.S. District Court in Alexandria, were the latest round in an acrimonious legal feud between ABC and Howard Safir, a senior official at the marshals' Tysons Corners headquarters, over a "20/20" report on the federal witness protection program overseen by Safir.

Safir filed a $10 million defamation complaint in 1981 in Fairfax County Circuit Court against ABC correspondent Geraldo Rivera and others, alleging the program, entitled "Hostages of Fear," made him appear to be lying. That case is pending. ABC retaliated with its complaint in federal court, alleging Rivera and others were illegally bugged.

ABC said in court papers that a "20/20" producer, Charles C. Thompson II, "noticed a small microphone hidden on the underside of a desk and then discovered an unknown technician in the adjacent office operating a . . . tape deck and wearing headphones."

The network said the unnamed informer confirmed that the ABC personnel were under electronic surveillance during their visit.

Safir and Assistant U.S. Attorney Thomas K. Berger told Bryan yesterday the identity of the informer, whose existence has been acknowledged by ABC, is central to Safir's efforts to defend himself against the ABC complaint.

Thompson has said in court papers the source is a high-ranking official at the marshals' headquarters, but has declined to name the person. "I just can't do that," Thompson said yesterday.

Wendy Addiss, a New York lawyer for ABC, said no decision has been made on the network's next move.