A photoelectrochemical (PEC) sensing platform for the detection of alkaline phosphatase (ALP) and its inhibitor F − ions was developed based on the Ag 2 S/Bi 2 S 3 composite. The signal variation strategy was triggered by the in situ formation and consumption of the electron donor. Ag 2 S quantum dots (QDs) on the Bi 2 S 3 surface effectively suppress the recombination of photogenerated carriers, leading to an enhanced photocurrent response. After ALP is immobilized on the Ag 2 S/Bi 2 S 3 surface, the in situ catalyzed hydrolysis of L-ascorbic acid 2-phosphate trisodium salt (AAP) appeared, resulting in the production of ascorbic acid (AA). AA acts as an electron donor, enhancing the photocurrent and offering a strategy for quantifying ALP activity. Sodium fluoride (NaF) induces a reduction in ALP activity, and by exposing the sensing platform to various concentrations of NaF, the inhibition of ALP can be identified. The developed PEC sensor demonstrates outstanding detection performance for NaF, featuring a linear concentration range from 100 pM to 20 μM and a low detection limit of 1.28 pM. The integration of Ag 2 S/Bi 2 S 3 to the in situ formation of electron donors in PEC technology presents an innovative approach for detecting ALP activity and its inhibitors. This platform delivers enhanced sensitivity and selectivity, making it valuable for diverse applications in detecting enzyme activity and screening their inhibitors in biofluid and food samples.