The sound of pistol shots echoed through the first-floor halls of the security-conscious State Department, but nobody paid much attention -- except Princess, a gun-shy Belgian Malonois pup who was sniffing for bombs around pillars and pots, and finally found one hidden inside an attache case.

The unusual sounds and sights at the usually staid building were all staged -- except Princess, of course -- as part of the Bureau of Diplomatic Security's exhibition of its latest antiterrorist technology. This technology includes gadgets and reforms aimed at keeping U.S. embassies, diplomats and citizens safer abroad.

Wednesday was "Security Awareness Day" at the department, and anyone interested in testing reflexes could stop by the Firearms Training Systems Center, grab a pistol and shoot it out with a terrorist in videotaped scenes of simulated assassinations and hostage-takings.

A participant was tested for knowing when to open fire in ambiguous situations, and then to determine who was shot -- the terrorist, a bystander or the participant.

Mistakes drew a response from the machine of "Poor judgment. No shoot situation." A correct response drew, "Good judgment," followed by a tally of hits and misses.

The pistol shots were the sound of primers exploding, which triggered a laser beam to put a bullet hole on the screen where the shot would have gone.

The training center was the main point of attraction during the day-long exhibition, which marked the second anniversary of the Bureau of Diplomatic Security and a year filled with "sensational stories of sex and spies in Moscow," as a letter from bureau director Robert E. Lamb to Secretary of State George P. Shultz noted.

Also drawing considerable interest was a portable bomb-detection machine, known as the Egis Mark II, which promises to make it easier to detect explosives in packages. Developed by Thermedics Inc. of Woburn, Mass., with $8.5 million in research funds from the department, the Egis detects chemical emissions from any kind of explosive -- including plastic -- hidden inside a package.

The department has experimented with the Egis at several embassies. According to Fred Brandt, a security specialist, "it's worked very well," including in detecting narcotics. The Egis is scheduled to go into use at U.S. embassies worldwide this fall.

Another innovation is a service the security bureau will offer to U.S. companies abroad -- an "electronic bulletin board" developed with the help of International Business Machines that provides information on terrorism in 60 countries.

Lamb, in his report to Shultz, indicated his bureau had been preoccupied the past year by disclosures of security breaches at the U.S. Embassy in Moscow, which he noted had "dramatically captured public and congressional attention."

New information about alleged Soviet penetration of the new and old embassy buildings in Moscow has led the bureau to "more reasoned conclusions about what actually happened," Lamb said, in an apparent reference to the department's latest assessment that Soviet agents never gained access to the old embassy chancery building, as one U.S. Marine guard alleged.

Those allegations and other disclosures by another Marine guard, Sgt. Clayton J. Lonetree, about his sex-and-espionage affair with a Soviet KBG agent, set off what Lamb called "the most comprehensive espionage investigation in recent memory."

The outcome has been a stronger U.S. counterintelligence program "in every area, from sophisticated protection against electronic eavesdropping to employee training and awareness programs," Lamb said in his report.

Lamb's report listed "tough new standards" for the protection of classified material at embassies; a new security system for cargo shipped to Moscow from the United States; new guidelines on fraternization by U.S. diplomats with East Bloc contacts; and new espionage training for Marine security guards and other Americans in the Moscow embassy.

The Marine guards' tour of duty at the Moscow embassy has been reduced from 18 to six months, and candidates for service now undergo "extensive screening to determine suitability for duty in Bloc countries," according to the report.