Administration officials are highly concerned that the Soviet Union will attempt to challenge the credibility of President Carter in the celebrated case of dissident Anatoly Scharansky with evidence that Scharansky's chief accuser was in fact once a CIA agent.

It was confirmed yesterday that the accuser, Dr. Sanya L. Lipavsky, a Jewish doctor, did work for the CIA in 1975, volunteering his services. Lipavsky, later a roommate of Scharansky's, has charged that Scharansky also was a CIA agent. The public corroboration that Lipavsky was linked to the CIA appeared in the current issue of Time magazine.

Although American officials see that as a highly tenuous link to Scharansky at best, it could be used in a Soviet trial to challenge Carter's public insistence that Scharansky never "had any known relationship in a subversive way or otherwise with the CIA."

A Scharansky trial, on charges of treason or espionage, long has been seen not only as a potentially explosive Soviet challenge to the Carter human rights campaign, but also as a flashpoint for American-Soviet detente policy. Detente is now at a precarious point over American outcries against Soviet military involvement in the Horn of Africa warfare between Ethiopia and Somalia.

President Carter and other top officials repeatedly have cautioned the Soviet Union, privately and publicly, about the American political consequences of bringing Scharansky to trial.

What is at stake is not only the fact that Scharansky, a Soviet computer expert, was one of the leading Jewish activists in the Soviet Union, and a major figure in the now-shattered group of dissidents monitoring Soviet compliance with the Helsinki human rights accords. Beyond that, a Scharansky trial has been seen as a potential Soviet attempt to link together American diplomats, Soviet-based U.S. journalists and the CIA in a wholesal plot. The premise would be that the entire dissident movement in the Soviet Union is foreign-concocted.

It is not known, American officials stress, whether the Soviet Union will decide to risk the international consequences of a dramatic "show trial" against Scharansky to parade such sweeping accusations. There are numerous lesser choices of scope and accusation which the Kremlin may choose.

Soviet legal preparations, however, informed sources said, now indicate that action is soon to begin against Scharansky, arrested last March and held incommunicado in Moscow's Lefortovo Prison. The Soviet Union was believed to be suspending its move until the completion of the Belgrade conference on European security and human rights, now in its final days.

Until now, there had been no public disclosure that the Soviet accusations against Scharansky could be seemingly buttressed by the Lipavsky CIA link.

Lipavsky, portraying himself as a "repented" dissident, last year had claimed that he once was a CIA agent, in addition to charging that American diplomats had recruited Scharansky and other Russians to spy for the CIA. At a press conference in Moscow, Lipavsky displayed a Parker pen which he said was used to pass secret instructions to him.

The American embassy in Moscow last March responded with a brief statement dismissing Lipavsky's accusations as "a classic case of disinformation" created by Soviet agents.

There is still strong suspicion on the American side that the now-confirmed Lipavsky CIA link was a plant by the KGB, the Soviet secret police, to establish a CIA-Soviet dissident tie, for later use against the United States.

Lipavsky, early in 1975, according to American sources, offered himself as a "walk-in" spy to the CIA, and reported to the CIA for about nine months in 1975. This was revealed yesterday by Time magazine, and it was confirmed from other U.S. sources.

This revelation at this time raised speculation that Carter administration sources wanted to see the information published in a pre-emptive move. That is, to reduce the public sting of evidence that could be presented at Lipavsky's trial. No U.S. official, of course, would confirm that, and some administration sources expressed dismay about this disclosure.

All U.S. sources were anxious to stress that the Lipavsky-CIA connection was in 1975, before the Carter administration took office.

Lipavsky reportedly volunteered to provide the CIA with information from his contacts in the Soviet scientific community. "Walk-in" spies are inevitably suspected of being KGB agents. Why the CIA accepted Lipavsky in any role is not fully explained except that the CIA decided to go along with Lipavsky to see what would happen, casting him off after nine months.

Later, Lipavsky shared a Moscow apartment with Scharansky, for a time considerably before Scharansky, who was 29 when he was arrested last year, became Lipavsky's target. When those charges were made last year. Tass, the Soviet news agency, said Lipavsky "as far back as 1972 became an agent of U.S. intelligence" but U.S. sources say that is totally incorrect.

Many U.S. officials were privately very disturbed when President Carter last June 13 publicly committed his prestige to the denial that Scharansky had any CIA connections, an apparently unprecedented denial by an American president concerning a foreign national.

Diplomats regard it as too risky, whatever the facts, for top officials to involve their personal credibility in such denials, for fear that the incident may rebound in some way, as this case can. According to the Time magazine account, Carter was aware of the limited Lipavsky CIA link when Carter made his comment and decided to risk the denial on Scharansky anyway on grounds that Scharansky was free of any CIA connection and it was important to say so.