The adsorption of phosgene (COCl2) on pristine, Al– and Si–doped boron nitride nanoflakes (BNNFs) is studied using density functional theory calculations. The adsorption energies of the most stable complexes, formed from interaction of COCl2 with the pristine, Al– and Si–doped BNNFs are -28.97, -78.71 and -171.60 kJ/mol at the M06-2X/6-31+G* level of theory, respectively. It is found that COCl2 experiences a chemisorption interaction over the doped BNNFs, significantly altering its structure with respect to the gas-phase molecule. The COCl2 adsorption can also induce a change in the HOMO–LUMO or SOMO–LUMO energy gap of the surface. In particular, the adsorption of COCl2 is found to decrease the HOMO–LUMO energy gap of Al–doped BNNF by about 30%. It is suggested that the Al– or Si–doped BNNFs can be considered as a potential material for detecting toxic COCl2.