Imagine that terrorists have just released a large amount of highly toxic nerve gas at a major event attended by thousands.
Casualties ensue, but emergency services know exactly how to react.
They use portable kits to rapidly screen hundreds of people who show no symptoms yet, so only those who have been exposed are hospitalised. They use real-time data on wind movements to quickly move people away from the toxic plume. Meanwhile, samples are rushed to a state-of-the-art laboratory to accurately identify the chemical used and help track down the perpetrators.
At the heart of a concerted effort to develop these capabilities is Singapore's defence research organisation DSO National Laboratories, which has enlisted scientists specialising in everything from biochemistry to atmospheric physics, to make it hard for terrorists to create mass panic and mass casualties using chemical means.
Dr Loke Weng Keong, director of DSO's Chemical, Toxins, Radiological and Nuclear Defence Programme, said: "It is a means to assure the public in a very fast manner that 'you're safe, you can go home'. It makes it (chemical agent) less attractive as a terrorist option."
Otherwise, he noted, people may have to be quarantined en masse even though they may not have been poisoned, which will stoke public alarm and overwhelm hospitals.
Fears of a chemical attack on civilian populations are very real. In 1995, for instance, 12 people were killed and thousands more injured when Japanese cult Aum Shinrikyo released sarin gas, a nerve agent, in the Tokyo subway.
Nerve agents were in the limelight again last month when North Korean leader Kim Jong Un's half-brother Kim Jong Nam was reportedly killed with the poison VX.
DSO's portable test kits - small enough to fit into a couple of suitcases - can screen blood samples from up to 100 people within an hour for the presence of nerve agents and other toxins.
The samples are treated with reagents in rows of small vials and put through a spectrophotometer, a machine that analyses whether chemical agents are present.
Previous kits could do so only for fewer than 10 people at a time, and could take more than two hours to get results.
The kits are the result of a collaboration with Singapore-based company Prestige BioResearch.
It will be about three more years before the technology can be scaled up for use in hospitals and for first-responders such as police and civil defence forces, said Dr Loke.
In another DSO department, engineers and computer scientists are working on the Hazardous Material Decision Support Tool (Hazmat), a system that can track wind speed and direction in three-dimensional space, in real time, to predict the dispersal of a toxic plume of chemicals. This will help emergency services contain the spread and move people away from danger.
A crucial part of the system is a light detection and ranging, or lidar, machine that emits a rotating laser. The beams are reflected back to the machine by the dust particles in the air, generating a picture of air movements within a radius of several kilometres from the machine, much like how radar tracks aircraft.
Last year, DSO put Hazmat through its paces in a desert in the United States, where a real chemical agent was released.
The agency was among participants from several countries invited by the US in a joint exercise to test their technologies.
Preventing an attack is also crucial. Associate Professor Roderick Bates, an expert in chemical synthesis at Nanyang Technological University, said that many chemical agents kill fast, citing the example of Mr Kim Jong Nam.
Said Prof Bates: "He lived only for a very short time after the attack and in that space of time, he would have had to seek help, be diagnosed, and have the antidote delivered and administered.
"That is the problem."
This is where Singapore's tight regulation of substances that could be used to make these chemicals comes in, Prof Bates pointed out.
"It would be difficult to obtain the key chemicals without alerting the authorities."
This article was first published on March 20, 2017.
Get a copy of The Straits Times or go to straitstimes.com for more stories.