A sensor based on cavity-enhanced absorption spectroscopy (CEAS) was implemented for the first time in a rapid compression machine (RCM) for carbon monoxide concentration measurements. The sensor consisted of a pulsed quantum cascade laser (QCL) coupled to a low-finesse cavity in the RCM using an off-axis alignment. The QCL was tuned near 4.89μm to probe the P(23) ro-vibrational line of CO. The pulsed mode operation resulted in rapid frequency down-chirp (6.52 cm-1/μs) within the pulse as well as a high time resolution (10 μs). The combination of rapid frequency down-chirp and off-axis cavity alignment enabled a near complete suppression of the cavity coupling noise. A CEAS gain factor of 133 was demonstrated in experiments, resulting in a much lower noise-equivalent detection limit than a single-pass arrangement. The sensor thus presents many opportunities for measuring CO formation at low temperatures and for studying kinetics using dilute reactive environments; one such application is demonstrated in this work using dilute n-heptane/air mixtures in the RCM. The formation of CO during first-stage ignition of n-heptane was measured over 802-899K at a nominal pressure of 10bar. These conditions correspond to the NTC region of n-heptane and such results provide useful metrics to test and compare the predictions of low-temperature heat release by different kinetic models.