Last week, when Secretary of State George Shultz arrived in Moscow for missile talks, he was forced to hold many of his most sensitive conversations in a communications trailer specially flown in and parked outside the American Embassy. Security at the Moscow embassy had been compromised by Soviet agents who allegedly seduced United States Marine guards and gained access to its most critical areas.

The United States has a new embassy building in Moscow, but it may never open. The structure, costing nearly $200 million, was built by Soviet workers, and the State Department now fears that it may be so thoroughly bugged that it might be unsalvageable. Meanwhile, President Reagan has declared that the Soviets will not be allowed to occupy their new embassy in Washington D.C. until the U.S. finds a way of clearing all the clandestine listening devices from its building in Moscow.

James Bamford, 40, is a lawyer by training, a former private investigator and an expert on espionage and counterespionage techniques. In his best-selling book, The Puzzle Palace, (Penguin, $7.95) Bamford chronicled the rise of the National Security Agency—the nation's official eavesdropper. He assessed the latest superpower spying war in his Ashland, Mass., home for former Senior Editor Michael Ryan.

What does it mean that our Moscow embassy has been "compromised?"

When embassy employees talk, they have to keep in mind that what they're saying might be bugged. For that reason we have "secure rooms." The most sensitive discussions in the embassy, those dealing with espionage, Soviet agents, U.S. policy towards the Soviet Union, are all held in these rooms. It's not expected that the Soviets could bug them: They're swept for bugs; the telephones and Teletypes are encrypted—put in code. The Soviets managed to attach listening devices on or near these secure telephones, Teletypes and typewriters. They didn't even have to try to break the code, because they were intercepting the communications at the source.

If these rooms were swept all the time, how could the bugs escape detection?

The United States uses a device that basically looks for radio frequencies; bugs pick up conversations, then transmit them outside the embassy. The Soviets used a fiber-optic device—a very small microphone attached to a glass fiber that transmits through light as opposed to radio signals. The conversation is converted into light pulses invisible to the human eye that do not give off radio signals. You can hide the device in the paint, and it's so fine—the width of a human hair—you can put it in the window putty. The State Department hasn't yet revealed precisely how the data were transmitted out of the building.

Was all this accomplished simply by compromising a few Marines?

Unfortunately that was the primary way. Security at the U.S. Embassy had little or no backup system during the graveyard shift, from midnight to dawn. Everything was guarded by a few Marines; they could allow carte blanche access to the secure rooms.

What systems should we be using?

In Moscow occasionally an alarm would go off. The Marines would simply turn it off. In a lot of buildings, when an alarm goes off, the time and location are registered in a record box. But the record box in our Moscow embassy was controlled by the Marines. Security was utterly pathetic.

How much damage have we suffered?

It's the most serious espionage case I've ever heard of. Lives have almost certainly been lost: One report says that six Soviets who worked undercover for us have been killed. In the embassies are the names and information that Soviet contacts are passing on to the CIA. When the Soviets get those names, several things can happen. They can kill the people. They can turn them into double agents—and that is very dangerous for the U.S. If the person works in a defense plant, for example, he may pass on information about a new bomber the Soviets are building. The CIA passes it on to the Defense Department, which creates counter-measures to that bomber. If that information is wrong, we may be developing systems to attack or defend against the wrong Soviet weapons.

Will we ever be able to use the new Moscow Embassy?

We have to tear it down. If we don't, we'll be guilty of manslaughter, in a sense. If you go in there, knowing there may be bugs, and you put CIA people in there who are going to meet with Russian nationals who may want to help us, information from bugs may lead to those nationals getting caught and killed. And I can't imagine any Soviet citizen cooperating with the U.S., knowing that embassy is still there and probably filled with bugs.

Have we learned from these mistakes?

The operations manual to our most sensitive satellite was stolen and sold to the Russians in 1978 for $3,000 by William Kampiles, a CIA employee. That should have awakened the government to security problems. Then you had the Walker spy scandal in 1985. After that a flea shouldn't have been able to get into a secure space and get out with any kind of document. Yet the following year, the U.S. had the Jonathan Pollard spy scandal. Pollard, an employee of Naval Intelligence who was spying for Israel, could go down in the Guinness Book of World Records for compromising the largest number of secrets in U.S. history—it is estimated at 360 cubic feet, about 860,000 pages of documents.

Why don't we pay attention to security?

Security is looked down on by diplomats. Their attitude is "I don't want to get involved in that; I'm trying to decide the future of the ABM Treaty." They don't realize that, if they don't pay attention to security, all the negotiating points in the ABM Treaty will go to the Russians.

What should we do about it?

It's probably not feasible, but I think Secretary Shultz should go. You need a shock to the rest of the government, to tell them that this won't be tolerated, and you need to shock them from the top on down. Shultz is just brushing it off and saying, "I'll go to Russia and play it like normal." If a senior administration official loses his job because of security, other senior officials will take the hint.