In this project, the ability and potential of B12N12, AlB11N12, and B12N11P nanocages to adsorb and identify the cyanogen bromide (BrCN) toxic gas in the environment has been investigated by the density functional theory (DFT) and time-dependent density functional theory (TD-DFT). The structures of all BrCN&B12N12, BrCN&AlB11N12, and BrCN&B12N11P complexes were optimized at the ωB97XD method at the 6-31+G (d, p) level of theory. From optimized structures, the adsorption energy (Eads), thermodynamic parameters (ΔH and ΔG), quantum parameters, atom in molecule (AIM) topological parameters, reduced density gradient (RDG) plots, molecular electrostatic potential (MEP) plots, electron localized function (ELF), solvent effect, and UV-visible spectrum of all studied models were calculated in absence and presence of static electric field (SEFz+0.01, SEFz+0.02, SEFz+0.03, SEFz+0.04 e.V).