B24P24 has higher potential to OF2 adsorption in comparison to B24N24. SH functionalization of studied nanocages improve the OF2 adsorption ability of them. Ead is suitable scale to propose the novel toxic gas sensor based on nanostructured. Ead and EHLG of studied nanocages have linear dependences.