Eight years before Robert P. Hanssen was arrested for espionage, Russia lodged a formal complaint with U.S. officials that an FBI agent tried to sell secrets to a Russian intelligence officer, according to a highly critical new report on the case.

But the FBI was never able to identify the culprit as Hanssen, who surreptitiously monitored the spy hunt by trolling through the bureau's classified computer system, according to the report.

FBI officials said the Russian government did not know Hanssen's true identity and did not provide enough information to U.S. officials to find him. Officials also stressed that the exchange was part of a common diplomatic dance between the two countries, with both sides fearing that the other was setting a trap.

But the revelation that Moscow itself alerted U.S. officials to Hanssen's activities adds to the long list of missed clues left by the former FBI counterintelligence officer during his espionage for Moscow.

The incident is recounted in an impending report by former FBI and CIA director William H. Webster, which contends that inadequate security and outdated computers at the FBI allowed Hanssen to spy undetected for two decades.

The report calls for a wholesale restructuring of the FBI's outdated and porous security system; recommends tighter access to sensitive information; and endorses wider use of polygraphs to ferret out spies, sources said. Officials expect its release as early as this week.

FBI Director Robert S. Mueller III said the bureau is already preparing to follow many of the Webster recommendations, including a dramatic expansion of internal polygraph tests and tighter security on computer access.

Hanssen had halted his spying activities in 1991 because he feared discovery, officials said. But in an apparent attempt to reestablish contact in 1993, Hanssen identified himself as a "disaffected FBI agent" to a Russian military intelligence officer and offered to sell him U.S. secrets, according to officials familiar with the Webster report.

He called himself "Ramon Garcia," which is a name he had used with the Russians since at least 1985.

But the Russian officer, apparently unaware of Hanssen's previous contacts, feared he was being ensnared in a trap and rebuffed the offer, U.S. officials said. The Russian government then lodged a complaint with the State Department about the incident through diplomatic channels, sources said.

"The matter was investigated when it was first brought to our attention," FBI spokesman John Collingwood said last night. "We were unable to identify the person about whom the Russians were complaining."

The severity of the Hanssen breach has sparked widespread reform efforts within the FBI, which was also embarrassed last year by a failure to turn over documents in the Timothy J. McVeigh bombing case and disclosures that many of the bureau's weapons and computers were missing.

In a meeting with reporters yesterday, Mueller said that expanded polygraph tests and other measures were needed to "professionalize security" at the FBI.

"Every employee should recognize in the wake of Hanssen that we have to focus more on security than we have," Mueller said. "I think we all understand the necessity of taking a polygraph if it detects a Hanssen down the road."

The bureau recently completed polygraph tests on 700 employees with access to highly classified information and is likely to expand the program to encompass several thousand others, officials said. Seven of those in the first group remain under investigation because of questionable results, officials said.

Top FBI officials, including former director Louis J. Freeh, long resisted polygraph testing of employees as detrimental to morale. Yet the FBI recommended widespread polygraphing at the CIA after the arrest of Soviet spy Aldrich H. Ames, and pushed for similar tests at the Energy Department in the wake of the Wen Ho Lee nuclear data investigation.

Hanssen, a 25-year FBI veteran arrested in February 2001, pleaded guilty to spying for Moscow and faces sentencing May 10. As part of his plea agreement to avoid the death penalty, Hanssen recently completed months of debriefings by FBI and CIA representatives.

Hanssen never faced a polygraph test during his espionage for the Soviet and Russian governments, and he took advantage of the FBI's ramshackle computer system to fish for sensitive information. Using some of the $1.4 million in cash and diamonds he received from his Russian handlers, he lavished gifts on a stripper.

Webster, who is scheduled to testify Tuesday at the Senate Judiciary Committee, said yesterday that the report is about 100 pages long with 22 classified appendices, most of which deal with "improving computer capabilities."

Webster, whose commission spent several days questioning Hanssen as part of its investigation, said Hanssen's espionage activities were fueled by "money plus anger."

Calling Hanssen one of the most complicated men he had ever come across, Webster said the former FBI counterintelligence expert thought of himself as "bright and intellectually better than his colleagues." At the same time, he was reclusive and did not receive the same promotions as colleagues who were considered "backslappers," Webster said.

Robert P. Hanssen, the former FBI counterintelligence agent who pleaded guilty to spying for Russia for two decades.