The U.S. government yesterday took the extraordinary step of discussing in a public courtroom its capability to intercept and decode some Soviet communications -- a subject that historically has been considered one of the nation's most sensitive national security secrets.

The disclosure at the opening day of the espionage trial of Ronald W. Pelton surprised intelligence specialists, who noted that U.S. intelligence agencies traditionally have declined to prosecute espionage cases where they feared such intelligence detail would emerge in public.

Federal prosecutor John Douglass in his opening statement talked about the U.S. National Security Agency's ability to "exploit" and "process" and "analyze" coded Soviet communications that travel by radio, microwave and cable between "terminal points," such as Soviet military or civilian centers.

Pelton's onetime NSA superior, Donald R. Bacon, talked about the special "compartment" at NSA where Soviet specialists work on the intercepted communications of the "highest level" authorities in the Soviet Union. His testimony's detail, coupled with the general description of NSA's capabilities to "exploit" coded Soviet communications, made it clear that the $35,000 the Soviets allegedly paid Pelton for information may have been one of the best espionage buys of the century.

The Reagan administration's decision to allow such disclosures about codebreaking capabilities was surprising in the wake of concerted efforts by CIA Director William J. Casey, President Reagan and other senior officials to stop The Washington Post and other news organizations from publishing a description of the principal communications intercept system Pelton is alleged to have sold to the Soviets.

The testimony also raised questions about how Pelton -- a brilliant analyst in NSA but a "wheeler dealer" in private life with a troubled financial history -- was allowed increasingly greater levels of access to virtually all intercept programs aimed at the Soviet Union even as his personal life was self-destructing.

One administration official said yesterday that the detailed disclosures about U.S. intelligence systems allegedly sold to the Soviets by Pelton reflects the Reagan administration's determination to get a conviction in the case, which is one of the worst intelligence losses suffered by the United States in recent history.

James Bamford, author of an authoritative book on the NSA, "The Puzzle Palace," said the courtroom disclosures by government officials were unprecedented. "It's the first time we have acknowledged we can break Soviet codes," said Bamford, adding, "It's always been implied . . . [and] it's not going to come as a shock to the Soviet Union, but other countries with high-technology cryptographic devices may have second thoughts" about the security of their communications.

In recent interviews, a number of U.S. intelligence sources have questioned the way that the government handles some of its most vital top-secret information. In order to restrict access, "compartments" are set up around sensitive technologies or operations and a person such as Pelton must be granted access individually to each one. The criteria for admission to what is called "sensitive compartmented information" is that the person must need information on it to perform his or her job.

Last November, during Pelton's bail hearing, a defense attorney disclosed in open court a codeword, "Ivy Bells," for one of the operations Pelton allegedly compromised. Sources said Ivy Bells was a submarine intelligence collection operation in the Sea of Okhotsk between the Kamchatka Peninsula and the eastern Soviet coastline. Pelton allegedly disclosed the location of the operation when he first met with Soviet officials in January 1980 and pointed it out on a map.

Under the classification system that controls access to programs such as Ivy Bells, NSA employes who are "cleared" into the "compartment" often gained more information than they needed to know for the performance of their tasks.

"You would certainly be surprised and you would probably be disappointed" to find out the broad range of access relatively low-level NSA employes get to some of the most sensitive intelligence operations targeted at the Soviet Union, a senior intelligence official said.

Ideally, U.S. intelligence employes who work on sensitive national security operations work in tightly controlled "compartments" so if one person betrays or sells what he or she knows, the entire operation or capability is not compromised. At NSA, many technicians and translators do not know how the information or foreign communications intercepts are obtained, the sources said.

But Pelton, according to yesterday's court testimony, apparently was considered an oracle on Soviet communications and had the broadest range of knowledge about what was intercepted, where it came from, how it was encoded by the Soviets and how NSA had successfully "attacked" some of those codes in the past.

One source has said that Pelton probably did not need all this detail, but a senior intelligence official defended the system of access that Pelton allegedly betrayed. The source cited the need for NSA analysts to know everything they can about the origin of their information as a means of improving the analysis.

In addition, those "compartments" that are erected to protect sensitive information frequently break down, sources said. An employe in NSA picks up details about other operations or capabilities over the course of years of service, especially in Pelton's case, where officials described him as a "troubleshooter" and font of knowledge about Soviet communications.

A related problem, according to some officials, is that sensitive information gets passed up to high levels without regard to protecting sources and methods.

"I didn't know why I had to be told what the [sensitive collection system] looked like, where it came from, how it was developed, where it was placed, [and] how the information was collected," said an official who has served in a senior national security post. "It was often to help keep the program funded, to say to us, 'Hey, look at this neat gimmick.' "

Pelton resigned from his NSA job in July 1979 after declaring bankrupty. He allegedly first contacted the Soviet embassy in Washington six months later. One senior source said that he was not able to explain why NSA did not step in when a person with such sensitive information was in financial trouble.

"An alarm bell should have gone off," this source said, "but it didn't . . . and once someone retires his clearances are revoked, and without a 'probable cause' to believe he is spying, no action or surveillance can be undertaken."