Ambient pressure X-ray photoelectron spectroscopy (APXPS) is combined with simultaneous electrical measurements and supported by density functional theory calculations to investigate the sensing mechanism of tungsten disulfide (WS 2 )based gas sensors in an operando dynamic experiment. This approach allows for the direct correlation between changes in the surface potential and the resistivity of the WS 2 sensing active layer under realistic operating conditions. Focusing on the toxic gases NO 2 and NH 3 , we concurrently demonstrate the distinct chemical interactions between oxidizing or reducing agents and the WS 2 active layer and their effect on the sensor response. The experimental setup mimics standard electrical measurements on chemiresistors, exposing the sample to dry air and introducing the target gas analyte at different concentrations. This methodology applied to NH 3 concentrations of 100, 230, and 760 and 14 ppm of NO 2 establishes a benchmark for future APXPS studies on sensing devices, providing fast acquisition times and a 1:1 correlation between electrical response and spectroscopy data in operando conditions. Our findings contribute to a deeper understanding of the sensing mechanism in 2D transition metal dichalcogenides, paving the way for optimizing chemiresistor sensors for various industrial applications and wireless platforms with low energy consumption.