On June 28, a man named Geoffrey Arthur Prime appeared in an English country courthouse charged with three counts of sexual assault on young girls over a period of two years. Police claimed that Prime, 44, had drawn up a list of potential victims while working for a taxi company in Herefordshire.

Just over two weeks later, Prime appeared again in the same court. This time his alleged offense was of a vastly different kind: spying. In accordance with stringent British laws on reporting criminal cases, news accounts merely said Prime had been charged under Section 1 of the Official Secrets Act -- which even without details meant that the case was serious.

Among the many mysteries in the Prime affair is how local investigators transformed a routine morals arrest into the uncovering of what U.S. officials were quoted over the weekend as saying is potentially the most serious security leak in Western intelligence since World War II.

Officials refused to comment today on reports from Washington about U.S. concern over British handling of the case, in particular, the British refusal to give the United States a full accounting of the suspected espionage. With Prime awaiting trial scheduled for late November, spokesmen said no comment is permitted and that as a national security issue, it is doubly off-limits.

"It would not be right to have further public discussion until the trial is completed," Attorney General Michael Havers said in Parliament.

But there is no inclination here to dispute the basic U.S. view that Prime's alleged supply of highly classified data to the Soviets for the nine years he worked at the Cheltenham electronic intelligence center was a major security breach.

Also not denied are reports that security procedures at the installation, known formally as General Communications Headquarters, may have been lax in the past -- since the main allegations against Prime predate the present government, which maintains that it is tightening up security procedures.

After Prime was charged on July 15, British newspapers reported without attribution or substantive details that a spy scandal involving Cheltenham was in the making and that it could be spectacular. Under the British "lobby" system, journalists are given such information by government and opposition sources on the condition that there may be no indication of the source.

The case disappeared from view on July 20 after Prime Minister Margaret Thatcher issued a bland statement in response to questions by opposition members of Parliament, saying, in effect, that the appropriate agencies were looking into security at Cheltenham. "Any charge under Section 1 of the Official Secrets Act is very serious," she said.

As a result of the British restraints on information, little is known about Prime. The youngest of three sons of a gardener, he joined the Royal Air Force in the early 1960s and was taught Russian. He was sent to West Germany, where he learned German and, according to U.S. reports, was recruited by the Soviets.

In 1968 he went to work at Cheltenham, the heart of an extensive British electronic intelligence network coordinated with the United States, Australia and Canada. By the time he left in 1977, he had reached the senior rank of advanced linguistics specialist and was one of several dozen Russian-language experts. It was apparently his high rank that gave him access to much of the sensitive information on NATO codes and military deployments that he allegedly passed to the Soviets.

According to local sources in the town of Cheltenham, Prime gave "pressure of work" as his reason for leaving intelligence work. He joined a local mini-cab company, which, among other contracts, transported computer tapes from the base to other locations. This could explain why the charges against him extend until 1981.

Friends said that Prime displayed a marked interest in Russian literature and went to London regularly to Russian cultural exhibitions. But they did not recall him making political statements. Prime was married twice and has three stepsons.

In 1981, Prime joined another taxi company and then briefly worked for a distillery. At the time he was picked up on the morals charges he was unemployed. After his arrest, police said they found a card file of names and addresses of potential victims and a list of women to whom he made obscene telephone calls.

On the issue of security at Cheltenham, British newspapers have printed interviews with Alex Lawrie, who worked as a linguist there for 22 years before retiring last December. The Guardian quoted him today as saying security there is "just about good enough to fend off a well-meaning drunk."

In an interview, Lawrie said, "I always had the impression that the Russians knew a great deal more about Cheltenham than I did." He said employes often walked out with computer papers and that gate checks were cursory. "If you go in in a car, you just have to slow down and hold the pass up to the window. It's not a close check."

British intelligence did win a vote of confidence today from former president Jimmy Carter, who is in London on a private visit. Saying he had no knowledge of any security breach on a scale attributed to Prime while he was president, Carter added, "Our confidence in British intelligence was very high."