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.
One-of-a-kind lab in region
The building on top of a hill near Kent Ridge looks like any office block built in the 1990s, but all the air and water in it is scrubbed and treated before they can get out.
Inside lies a laboratory staffed by a small group of scientists who are on call 24 hours a day, 365 days a year. They are on even higher alert during major events such as the National Day Parade and Formula One Grand Prix.
These men and women have a duty not only to the country but also to the world: to defend against chemical weapons.
Since 2003, the Chemical Verification Laboratory at Singapore's defence research organisation DSO National Laboratories has been the only facility in South-east Asia authorised by the Organisation for the Prohibition of Chemical Weapons (OPCW) to officially analyse samples of suspected chemical weapons, one of about 20 labs around the world.
All such tests are confidential.
Set up in 1998, the lab specialises in identifying chemicals listed under the Chemical Weapons Convention, which Singapore ratified in 1997, such as the toxic VX which is said to have been used to assassinate North Korean leader Kim Jong Un's half-brother Kim Jong Nam.
Having its own facility also means Singapore can rapidly respond to an attack at home, said Dr Loke Weng Keong, director of DSO's Chemical, Toxins, Radiological and Nuclear Defence Programme.
"We can't rely on Interpol to patrol our streets," he said.
The lab has sophisticated machines that separate samples into their constituent chemicals and measure their molecular weight.
It can also make small amounts of the chemicals as reference samples for comparison.
To prevent unauthorised removal of dangerous substances from the lab, it operates on a "two-key" system where no one person can have lone access to the chemicals.
The lab is now enhancing its capabilities to be able to identify chemical agents in human tissue samples, which is more challenging because the chemicals have combined with biological molecules.
It is also participating in OPCW "confidence-building exercises" with other countries to improve techniques for analysing a class of chemical agents called toxins, which are much larger molecules than nerve agents and more difficult to identify.
To encourage international cooperation, DSO also hosts the Singapore International Symposium on Protection against Toxic Substances every three years, bringing together ideas from the academic, public and private sectors. This year's event will take place from tomorrow to Thursday.
The agency said this will further strengthen Singapore's defence against constantly changing unconventional threats.
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."