The interaction of cyanogen molecule with Al12N12 nanocage has been studied using density functional theory (DFT) at CAM-B3LYP/6-31+G(d) level. Geometric, electronic structure and natural bond orbitals (NBO) analysis display that adsorption of cyanogen onto exterior surface of Al12N12 is physisorption with adsorption energy (Eads) equal to −55.36 kJ/mol. UV–vis study shows a high intensity peak in 388.9 nm due to interaction of gas with nanocage. It is expected that Al12N12 will be used in designing novel materials for potential applications to detect toxic cyanogen molecule.