WASHINGTON, Nov. 14— In 1969, after years of tortuous negotiation, the Nixon Administration signed an agreement with the Soviet Union providing for new embassy complexes in Washington and Moscow.
The American project was to be the most elaborate and expensive United States embassy ever, a testament to American wealth and power.
Today, the eight-story American chancery in Moscow stands useless, infested with spying systems planted by Soviet construction workers, a stark monument to one of the most embarrassing failures of American diplomacy and intelligence in decades.
Over the years, the United States has spent $23 million on the building, but more than twice that amount in an attempt to figure out how the Soviets used eavesdropping devices to transform it into a giant antenna capable of transmitting written and verbal communications to the outside.
After a saga of suspicious behavior by Soviet work crews, electronic devices buried in concrete and investigators hanging like rock-climbers from the roof, a secret cable to the American Ambassador resulted, finally, in a halt to what a 1987 Senate committee described as ''the most massive, sophisticated and skillfully executed bugging operation in history.''
The Bush Administration will have to decide whether to follow President Reagan's advice that the building be torn down.
What went wrong is a spy story full of confusion, compromise and bureaucratic conflict. A Tale of Two Hills, And the Better Deal
The embassy saga dates back to 1934, when William C. Bullitt, the first American Ambassador to the Soviet Union, asked Stalin for a new embassy. But negotiations did not begin in earnest until the early 1960's.
Although the United States was offered a site high atop the Lenin Hills overlooking Moscow, it opted for an 85-year-lease on a site more accessible and centrally located: a 10-acre parcel overlooking the Moscow River and within walking distance of both the Ambassador's residence and important Soviet Government buildings.
Although neither side could have guessed it in 1969, when the site agreement was signed and eavesdropping techniques were less dependent on microwave telephone transmissions, the Soviets got the better deal, an elevated site on Mt. Alto, a hill overlooking Washington, tailor-made for espionage.
For four years, American and Soviet negotiators labored unsuccessfully over the terms of the construction. But in 1972, during the heady days of detente, President Nixon ordered a reluctant State Department to reach an agreement. In what would later be recognized as a crucial blunder, the United States gave the Soviets control of the design and construction of the mission in Moscow.
''I didn't favor it because it was a one-sided deal,'' recalled William P. Rogers, who signed off on the deal as Secretary of State in the Nixon White House. ''But I was carrying out the orders of the White House.''
But Dr. Henry A. Kissinger, Mr. Nixon's national security adviser at the time, declines to accept blame, saying the State Department did not voice strong objections. ''I don't exclude I said to somebody, 'See what you can do to get it done,' '' he said. ''But that isn't the same thing as saying, 'Go ahead, cost what it may.' ''
The Soviets proceeded to build pre-cast concrete pieces for the embassy building in their own factories, out of view of American security experts. In signing the accord, Washington miscalculated that inspection of the pieces as they arrived at the site would be sufficient to enable security personnel to detect eavesdropping devices. Since the United States had the right to do all the finishing work - from inside walls to windows and doors - there was little concern that the Soviets would be able to implant bugs that could not be detected. Security Slips Between the Cracks
From the outset, the project was beset by clashes within the Washington bureaucracy which delayed decisions on security matters. The chain of command was never clearly defined, as security, construction, diplomatic and intelligence functions were carried out by different offices with different agendas.
At the time of the groundbreaking in 1979, there was still no clear American plan for the on-site security needs or what the specialists were supposed to look for. American intelligence officials in Moscow warned that they would not have the necessary equipment and personnel to handle the problem of Soviet bugging once construction began.
By late 1979, several thousand precast elements of at least 7,000 pounds each were arriving on the building site. All of them had to be inspected. ''We started getting technical security people saying, 'Hey, guys, you have problems,' '' said a State Department official who was in Moscow at the time. ''They weren't listened to.''
Meanwhile, the State Department's Office of Foreign Buildings Operations, already under pressure from Congress because of cost overruns and poor results in construction projects in other capitals, was pushing to move the job along.
Instead, they found that the Soviet idea of efficient construction was vastly inferior to American standards, and they quickly lost patience with Russian absenteeism, drunkenness on the job and sloppy work habits.
''We treated this as a cost-driven operation and it became critical to move as quickly as possible,'' said Joseph S. Hulings 3d, the State Department's current coordinator on the embassy project.
Not until early 1982 was a specially trained team of security experts dispatched to Moscow. Armed with experimental X-ray scanning machines that could inspect construction elements without destroying them and cold-weather gear from Eddie Bauer, they invented inspection procedures as they went along.
The specialists were trained rock-climbers who worked through Moscow's winter nights in temperatures that fell to 40 degrees below zero, hanging off the side of the building to get from floor to floor.
The team was stunned when over the course of a few months, they discovered that the Soviets had put permanent eavesdropping systems into the actual structure of the building.
''We found things that didn't belong there based on shop drawings,'' said Frank Crosher, a security engineer who worked on the site from 1980 to 1982 and managed the embassy security team from Washington until 1986. ''We found cables in the concrete as well as design discrepancies, millions of bits of data.''
Along the way, they discovered interconnecting systems so sophisticated that they could not be removed from the steel and concrete columns, the beams, the pre-cast floor slabs and sheer walls between the columns. They found electronic ''packages'' where a piece of steel reinforcement in the flooring should have been, and resonating devices that allowed the Russians to monitor precisely both electronic and verbal communications.
Their job was made more difficult by decoys made to look like bugs and garbage from the construction process.
The Soviets, for their part, made every effort to thwart security efforts. In the spring of 1983, for example, after the American security team brought in new radiographic equipment to inspect structural columns, the Soviet construction workers went on a two-week strike, citing hazards to their health.
As work on the outer structure drew to a close, the Soviets suddenly became anxious to speed up construction of the top floors, where secret embassy functions were to be conducted. At the same time, an external Soviet-owned freight elevator was mysteriously disabled, which meant that Soviet workmen needed more access to the inside of the building.
But never did the American experts lose confidence that they could eventually figure out and neutralize the Soviet systems.
''Intelligence agents were saying, 'Give us a year and we'll fix it,' '' said one Administration official involved in the project. ''We had no other choice than to believe them. No one wanted to admit failure.''
Despite the mounting evidence of Soviet penetration, it took until August 1985 before the State Department ejected the Soviets from the construction site.
On Aug. 15, Mr. Lamb sent a secret cable to Ambassador Arthur A. Hartman recommending that he shut down the job. Mr. Hartman locked out the Soviets and stopped construction two days later. C.I.A.'s Confidence Plays Poorly in Congress
In late 1985, some members of Congress began to suspect that the problems might be irreparable. Following a visit to Moscow by staff members of the Senate Select Committee on Intelligence in December, the committee scheduled a series of closed briefings on the matter in the spring of 1986.
It was then that the C.I.A. admitted for the first time that the Soviets had successfully incorporated complex and impenetrable surveillance systems into the building structure.
But the C.I.A. and many technical experts still remained convinced that they could crack the Soviet systems.
A lengthy, highly classified memo from the C.I.A. to the Senate Intelligence Committee in December 1986 asserted that American intelligence analysts and engineers would be able to neutralize the building, even though they acknowledged that they were not yet able to figure out the Soviet systems.
But allegations surfaced in the spring of 1987 that Marine guards had dated Soviet women and allowed K.G.B. agents access to sensitive information. Disclosures of the electronic penetration of the new embassy followed in April 1987, and for the first time, it became publicly known that the Soviets had installed a wide variety of intelligence-gathering devices whose technology was not understood by the United States.
At about the same time, the Senate Intelligence Committee unanimously recommended razing the building.
Still, the recommendation to tear the building down was vigorously opposed by the State Department, all the way up to Secretary of State George P. Shultz. Recommendation: The Wrecking Ball
Expert studies followed.
The President's Foreign Intelligence Advisory Board recommended in July 1987 spending about $80 million to use existing technology and develop new methods to clear the new chancery of eavesdropping devices. A report by James R. Schlesinger, a former Director of Central Intelligence, recommended destroying the top floors of the chancery and constructing a six-story annex at a cost of at least $35 million.
Finally, a study commissioned by the State Department concluded that razing the building and constructing a new one in its place would cost less, be less physically dangerous and take less time than neutralizing the listening systems in the uncompleted building. Mr. Shultz recommended to Mr. Reagan that the building be destroyed.
In the absence of Congressional objections, the State Department will begin a $3 million architectural and design plan for a new chancery next week. The Bush Administration will have to decide whether to accept Mr. Reagan's recommendation to raze and reconstruct the building, a project that could cost half a billion dollars and take another decade, according to some State Department estimates. President Reagan has made it clear that the Soviets, meanwhile, will not be allowed to occupy their new Washington embassy building, which is ready for use, until the United States moves into its own new quarters in Moscow.
In retrospect, the experts say, the embassy fiasco is a reflection of the American way of conducting diplomacy - the arrogance of negotiators who regarded treaty-signing as loftier than security matters, the hubris of intelligence experts who firmly believed that they could neutralize any system the Soviets could develop, and the bureaucratic inertia of American policymakers who ignored danger signs along the way.
''The culprit,'' Mr. Schlesinger said, ''is American complacency, the tendency to assume that the Russians are technically inferior to us and that we can handle them.''
Robert E. Lamb, Assistant Secretary of State for Diplomatic Security, put it more bluntly. ''We knew the Russians were going to bug it, but we were confident we could deal with it,'' he said. ''Obviously, we were wrong.''
Photo of the new U.S. Embassy in Moscow (NYT/Paul Hosefros)