The efficient inactivation and sensitive detection of waste water and food stuffs polluted by pathogenic bacteria are vital for ensuring food safety and protecting people’s healthy. Herein, a 2D copper phthalocyanine-based covalent-organic framework (COF) embraced with Cu-N4 single atomic sites and silver nanoparticles (denoted as CuPc-Dha-COF@AgNPs) was employed as a bifunctional bioplatform for the efficient sterilization via the multi-modal antibacterial mechanism and the sensitive detection of pathogenic bacteria via the photocatalytic oxidization of glutathione (GSH) using a photoelectrochemical (PEC) technique. Given the superior photothermal conversion efficiency, the high production efficiency of reactive oxygen species, the enhanced H2O2 self-supplying capability, and the controlled release of Ag+ ions under near-infrared light irradiation (808 nm and 1.0 W cm−2), 100 % bacteria were eliminated by CuPc-Dha-COF@AgNPs (200 μg mL−1) at 24 h. Furthermore, the CuPc-Dha-COF@AgNPs-based PEC biosensing platform exhibited highly selective determination ability toward GSH because of its superior mimetic enzyme performance caused by Cu-N4 single atomic sites, narrow bandgap, wide photoabsorption performance, and high separation of photoinduced electrons and holes. It thus showed an ultralow detection limit of 99 fM toward GSH within wide range from 1.0 pM to 1.0 nM, as well as high selectivity, good stability and reproducibility, and promising practicality. This work provides a new strategy for the sterilization and sensitive detection of pathogenic bacteria, simultaneously implementing and monitoring measures for the water system and food safety.