The new technology that uses a form of invisible light called terahertz radiation (T-rays), is more sensitive than current sensors and even works below normal atmospheric pressure.
"You could imagine setting this up around the perimeter of an area where soldiers are living, as a kind of trip wire for nerve gas," said Henry Everitt, lead author from Duke University.
T-rays are already used to detect tumours and screen airport passengers, they zap gas molecules to create a unique spectrum "fingerprint", like a bar code.
The team blasted a cloud of gas with two beams, a terahertz beam, tuned to the energy of the gas molecule they were looking for and an infrared laser.
"It's kind of like whacking a molecule with an infrared sledgehammer," Everitt said.
"We just have to tune each beam to the wavelengths that match the type of molecule we're looking for, and if we see a change, we know it has to be that gas and nothing else," he added.
Initially the team will focus on toxic industrial chemicals such as ammonia, carbon disulfide, nitric acid and sulphuric acid.
Eventually, the technique could be used by law enforcement detecting toxic gases generated by meth labs, and other situations where detection at the gas' source isn't feasible.
The results of the study were published in the journal Physical Review Applied.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.