The detection of organic pollutants in the environment is crucial due to their significant impact on human health. Formyl fluoride (HFCO) and carbonyl fluoride (COF2) are toxic gasses that contribute to stratospheric ozone depletion. To explore a potential sensor material for these compounds, the adsorption properties of HFCO and COF2 on pristine (8, 0) single-walled carbon nanotubes (SWCNTs), aluminum-doped SWCNTs (Al-SWCNTs), nitrogen-doped SWCNTs (N-SWCNTs), and aluminum nitride nanotube (AlNNTs) were investigated using density functional theory (DFT) calculations. Obtained structural and electronic results reveal no significant after HFCO and COF2 adsorption on pristine SWCNT. However, the conductivity and polarizability of Al- SWCNT increases throw HFCO and COF2 adsorption. It was shown that this adsorption strongly depends on molecular orientation toward SWCNT. Structural and electronic findings show that studied molecules undergoes a physical adsorption to N- SWCNT. However, AlNNT was also found to show significant changes in structural and electronic properties after HFCO and COF2 adsorption. This adsorption leads to a significant (nearly 45%) reduction in the HOMO-LUMO gap of AlNNTs. Therefore, it is proposed from this study that Al-SWCNTs and AlNNTs are promising candidates for HFCO and COF2 gas sensors. Moreover, AlNNTs exhibit intrinsic detection capabilities without structural manipulation via doping which makes AlNNTs particularly attractive for sensor applications. Moreover, the capability of AlNNT without manipulating makes this nanotube a good and easy made candidate for these compounds adsorption.