It was during Richard M. Nixon's first presidential visit to Paris in 1969 that White House aide John D. Ehrlichman discovered that friends sometimes spy on friends.

After retrieving his coat from a butler in the official guest house one morning, Ehrlichman discovered a small pin with a listening device clumsily stuck in the lining, apparently by French intelligence agents.

"I gave it to the Secret Service boys, and they shrugged," Ehrlichman recalled this week. "It was business as usual."

The arrest of Navy analyst Jonathan Jay Pollard last month on charges of spying for Israel was greeted with incredulity on the part of some officials, who know that Israel and the United States routinely share many secrets. But intelligence experts say that, although allies rarely plant agents, they will do almost anything else to keep tabs on each other.

"The only aberrational thing," Michael J. Glennon, former legal counsel to the Senate Foreign Relations Committee, said, "is that someone got caught."

Thus, France eavesdrops on U.S. dignitaries, Canada tails French diplomats, the United States wiretaps Micronesian negotiators, Taiwan collects secret documents from the State Department. One ally may spy on another to learn its fallback position in a negotiation, to gain access to secret economic data or even to find out how much its own intelligence service has been penetrated.

"We use all kinds of human agents in countries all over the world," former Central Intelligence Agency director Richard M. Helms said on ABC-TV this week. "The only sin in espionage is getting caught, and that friends spy on the United States surprises me not at all."

A secret 1981 message from the Defense Intelligence Agency (DIA) stamped "NOFORN" -- meaning not to be shown to any foreigners -- gives some indication of U.S. interest in friends as well as foes.

The message instructs military attaches and other intelligence officers to report on a continuing basis on the intelligence services of Canada, Israel, West Germany, Greece and 30 other nations. It demands "detailed information" on their "locations, operations, capabilities, intentions, effectiveness . . . personnel, equipment, communications and capabilities, power and influence, procedures, funding and support (internal and external), training, doctrine and policy, uniforms, insignia and credentials."

The United States has many ways to gather such information, according to intelligence experts. The National Security Agency (NSA) intercepts telephone calls, military attaches abroad strap sensitive cameras to their Cessna airplanes, U.S. satellites continue taking pictures while orbiting over friendly lands.

Some experts caution that there is a wide gap between collecting information, even through clandestine eavesdropping or photography, and seeking or planting agents. William E. Colby, another former CIA director, said he once had to explain that difference to a member of the Canadian parliament who was angered upon learning of a CIA report on his country.

"Sure, we write reports on all kinds of things," Colby said he told the Canadian. "But no, we wouldn't spy on Canada, absolutely not."

Colby said there are few occasions when the United States would risk embarrassment by planting an agent in a friendly nation, as the Netherlands did inside the NSA in the 1950s.

"Every nation has to make a judgment of whether the value of what you're after is worth the impact of getting caught," he said. "Canada is an open society, go ask somebody" what you need to know.

Retired lieutenant general Lincoln D. Faurer, who headed the NSA until March, said covert intelligence-gathering against friends is "a questionable practice, but I guess I wouldn't suggest that most countries don't do it." The United States, Faurer added, would be "more circumspect . . . than Israel appears to have been in this case."

"I doubt we would be paying someone in Israel to bring us information," he said.

But another retired senior intelligence official said the United States has taken risks among allies. Without confirming that such an operation took place, the official mentioned as a logical example U.S. curiosity about Israel's alleged nuclear weapons industry.

"Let's suppose, for example, that the Israeli government declined to let Americans inspect the Dimona nuclear reactor, as they did for many years," the official said. "And let's suppose the American government thought it was so important to find out what was going on in that reactor, as we well might, that we would mount an intelligence operation to find out."

Officials are loathe to discuss friendly espionage, and allied diplomats caught red-handed frequently are "PNGed" without fuss -- declared persona non grata, in State Department jargon, and sent home. In fact, Israeli parliament member and former ambassador Simcha Dinitz complained that Washington had handled the Pollard case "as if we were a hostile country."

"If cases like this would have happened in the past, it would always be dealt with in a very discreet manner, away from the public eye," he said on ABC-TV.

But from time to time in the past -- frequently when bilateral relations were already strained -- tiny corners of the vast espionage and counterespionage networks that even allies maintain have come into view:

*In April 1979, when South Africa was angry at the Carter administration's antiapartheid policies, Prime Minister Pieter W. Botha expelled the U.S. defense attache and two aides after South Africa discovered sensitive cameras on the attache's plane, which had flown all over southern Africa.

Botha said he would have expected such behavior from the Soviet Union but "not from the leading western country." U.S. officials privately did not deny Botha's allegations but described the photography as routine information gathering, not espionage.

"The job of the defense attache is to spy on the other guys, to collect information on their military capabilities," William M. Arkin, a national-security specialist at the Institute for Policy Studies, said. "You can do certain things from a satellite or from a U2 [high-flying spy plane], but when you're 1,000 feet up with a camera you can count the hairs on a guy's mustache."

*Also in 1979, when Taiwan was seething at Washington's growing friendship with Peking, the Federal Bureau of Investigation discovered that Taiwanese agents had obtained secret U.S. war contingency plans that could prove embarrassing to the U.S.-China relationship. Taiwan's military intelligence was plugged in so well that classified documents circulating at the State Department's China desk on a given Friday would show up in Taipei on Monday, U.S. officials said later.

The State Department added Taiwan to its "criteria country list," a roster of nations against which the FBI focuses its counterintelligence operations.

*The Canadian Broadcasting Corp. reported several years ago that, at the height of the Quebec separatist movement, Ottawa had authorized an espionage campaign on French diplomats suspected of aiding French-speaking separatists.

*During the Koreagate scandal in the mid-1970s, when the South Korean Central Intelligence Agency was being investigated for bribing U.S. congressmen in return for favorable treatment, Washington was reported to have collected some of its best evidence by bugging the Blue House, the South Korean presidential mansion.

At the same time, then-Rep. Edward J. Derwinski (R-Ill.) was investigated -- but not indicted -- for allegedly tipping off the South Koreans to an element of the investigation. The basis for the suspicion, sources reported then, was an intercepted phone call from Derwinski to the South Korean Embassy. When Iranian militants occupied the U.S. Embassy in Tehran in 1979, they seized and eventually published a CIA report on Israeli intelligence that said Israel had blackmailed, bugged and offered bribes to U.S. officials in a search for secret intelligence and technical information. One of the highest priorities of Israeli intelligence, the CIA concluded, was "collection of information on secret U.S. policy or decisions, if any, concerning Israel." Embassy buggings surfaced in 1970, according to Seymour M. Hersh's account in "The Price of Power." Nixon administration officials learned of a leak from their National Security Council staff, Hersh wrote, when they read a summary of a wiretap on the Israeli embassy in which Richard N. Perle, then a Senate aide and now a Defense Department official, allegedly discussed classified information with an embassy official.

Since passage of the Foreign Intelligence Surveillance Act in 1978, the FBI and the NSA have had to seek approval from a secret federal court to wiretap embassies or install closed-circuit televisions, transmitters to track vehicle movements or other surveillance devices. The number of such approvals has increased from 319 in 1980 to 549 in 1983, according to a report by the Senate Select Committee on Intelligence.

FBI Director William H. Webster said that the FBI, with limited counterespionage efforts, devotes such surveillance efforts almost exclusively to hostile countries, presumably those on the criteria list.

But Arkin and other intelligence experts said that NSA listening posts in Virginia and Maryland can intercept many telephone conversations without wiretaps -- and those posts do not limit themselves to hostile embassies.