Context. The inner few AU of disks around young stars, where terrestrial planets are thought to form, are best probed in the infrared. The James Webb Space Telescope is now starting to characterize the chemistry of these regions in unprecedented detail, building on earlier results of the Spitzer Space Telescope that the planet-forming zone of disks contain a rich chemistry. One peculiar subset of sources characterized by Spitzer are the so-called CO2-only sources, in which only a strong 15 μm CO2 feature was detected in the spectrum. Aims. One scenario that could explain the weak or even non-detections of molecular emission from H2O is the presence of a small, inner cavity in the disk. If this cavity were to extend past the H2O snowline, but not past the CO2 snowline, this could strongly suppress the H2O line flux with respect to that of CO2. For this work, we aimed to test the validity of this statement. Methods. Using the thermo-chemical code Dust And LInes (DALI), we created a grid of T Tauri disk models with an inner cavity, meaning we fully depleted the inner region of the disk in gas and dust starting from the dust sublimation radius and ranging until a certain cavity radius. Cavity radii varying in size from 0.1 to 10 AU were explored for this work. We extended this analysis to test the influence of cooling through H2O ro-vibrational lines and the luminosity of the central star on the CO2 /H2O flux ratio. Results. We present the evolution of the CO2 and H2O spectra of a disk with inner cavity size. The line fluxes show an initial increase as a result of an increasing emitting area, followed by a sharp decrease. As such, when a large-enough cavity is introduced, a spectrum that was initially dominated by H2O lines can become CO2-dominated instead. However, the cavity size needed for this is around 4–5 AU, exceeding the nominal position of the CO2 snowline in a full disk, which is located at 2 AU in our fiducial, L* = 1.4 L⊙ model. The cause of this is most likely the alteration of the thermal structure by the cavity, which pushes the snowlines outward. In contrast, our models show that global temperature fluctuations, for example due to changes in stellar luminosity, impact the fluxes of H2O and CO2 roughly equally, thus not impacting their ratio much. Alternative explanations for bright CO2 emission are also briefly discussed. Conclusions. Our modeling work shows that it is possible for the presence of a small inner cavity to explain strong CO2 emission in a spectrum. However, the cavity needed to do so is larger than what was initially expected. As such, this scenario will be easier to test with sufficiently high angular resolution (millimeter) observations.