The bluegill is a freshwater fish of many talents, able to elude predators by hiding in submerged tree stumps and to survive for weeks without food.

Now, with the help of a scientific contraption developed by the U.S. Army and a private company, the fish also is keeping vigil over the Washington region's water supplies, where it might be able to save millions of lives in the event of a terrorist attack.

The scaly sentinels are a key component of the IAC 1090 Intelligent Aquatic Biomonitoring System, a new water-monitoring device that electronically analyzes the behavior of eight captive bluegills to detect the presence of chemical toxins or other contaminants. The system is also in use in New York City and San Francisco.

If the fish show signs of distress in response to something in the water, the system automatically trips an alarm, takes samples, and summons authorities by e-mail and pager so that they can investigate whether there is a threat to humans. It costs $45,000 to $110,000.

"We're basically using it as part of an early-warning contaminant-monitoring system for water in the national capital region," said Stuart A. Freudberg, director of environmental programs for the Metropolitan Washington Council of Governments. "This is another tool in the arsenal, if you will, that water utilities use to make sure the water in this region is safe."

Freudberg said the system has been in place for at least six months and monitors water for a number of Washington area utilities serving 4.5 million people. He declined to reveal how many devices are in place, citing security needs.

Ever since Sept. 11, 2001, governments at all levels have sought ways to deter and defend against the next terrorist attack. One scenario that officials fear is an attempt by terrorists to dump chemicals or other toxic agents into the water supply, an attack that could kill or sicken millions of people.

Utilities have always taken routine steps to ensure the quality of the water they provide, including the regular testing of samples and the treatment of water to kill pathogens. Such measures continue, and experts point out that poisoning a city's water supply would be difficult because the sheer volume would dilute and overwhelm most chemicals. Yet the risk of such an attack has prompted officials to search for every tool they can find.

For the past six months, the San Francisco Public Utilities Commission has used bluegills in its treatment plant south of the city to monitor water provided to about half of its 2.4 million customers, spokesman Tony Winnicker said.

"It's another layer of protection," he said. "The fish are extremely sensitive to minute changes in the source water quality, so even if we don't know what the fish react to, we know that they are reacting to something. . . . With traditional sampling, you can only find what you are looking for. The fish might pick up something that you are maybe not specifically looking for."

The biomonitoring system is a 2-by-3-foot device developed for commercial use by Intelligent Automation Corp. of Poway, Calif., with technology patented by the Army. The device resembles a luggage trunk shot through with cables and tubes and hooked up to a monitor.

Eight juvenile bluegills swim in a row of solitary compartments the size of a large mail slot, each fish submersed in piped-in water and separated from the others by a pane of frosted glass. Electrodes attached to each compartment convey data about the fish's movements and breathing patterns to a nearby computer, which monitors the data and sounds the alarm if at least six of the fish show signs of distress.

"It's kind of similar to a doctor putting a stethoscope on your chest -- it's to look for something that's not normal," said Tom Shedd, a research biologist with the U.S. Army Center for Environmental Health Research at Fort Detrick, who helped invent the system. "It's the same thing here, only what you are looking at is . . . the breathing apparatus of the fish."

The sensors do not touch the bluegills' chests, of course, Shedd said. Instead, when the fish use muscles to breathe, the action sends a low-level electrical impulse through the water that can be picked up by the two electrodes attached to each fish chamber. From those signals, scientists can tell how quickly and deeply the fish are breathing and can detect when they "cough," or try to discharge an irritant from their gills, Shedd said. All of which, along with the fish's movements, can signal the presence of a toxin.

The system uses bluegills because the fish are sedentary, Shedd said, and because the Environmental Protection Agency has a "huge" database showing how various toxins affect them. Although adult bluegills can grow to be 13 inches long, the system relies on juveniles that are generally no longer than four inches. It requires that they remain in the chamber, unfed, for two-to-three-week tours of duty, Shedd said.

Such conditions do not upset the fish, said William A. Lawler, an executive with Intelligent Automation, who noted that the system wouldn't work if the device itself made the fish agitated. "We want them very calm and very happy," he said. "We're monitoring against stress."

The company's key contribution was to add software that automated the analysis of the raw data and the sending of alerts, because scientists cannot be on hand all the time, Lawler said.

The system can monitor either untreated or treated water as long as chlorine is removed. It also can be configured to directly measure water temperature and acidity, which can agitate fish without posing a threat to humans. The system cannot detect bacteria such as anthrax, E.coli and fecal coliform, but utilities have other tests for such things, Lawler said.

So far none of the municipal systems has found signs of a terrorist attack, although a few have had alerts for disruptions in algae levels and the like, officials said. One city received an alert after janitors opened the device to check on the fish, spooking them, Lawler said.

More serious was the "substantial alarm" at Fort Detrick in the spring of 2004, when fish at the facility's water treatment plant on the Monocacy River signaled a problem, Shedd said. The fish died, and testing showed the presence of materials typically used in pesticides and herbicides. Officials never found the source, but the toxins never got into the drinking water.

"We had confidence that that didn't take place," Shedd said.

Lawler said the bluegills don't always have to give their lives to be of service. "The idea is to prevent harm to the fish and get a handle on something before there is a problem," he said.