Multiphase and multicomponent fluid flow in the shallow continental crust plays a significant role in a variety of processes over a broad range of temperatures and pressures. The presence of dissolved gases in aqueous fluids reduces the liquid stability field toward lower temperatures and enhances the explosivity potential with respect to pure water. Therefore, in areas where magma is actively degassing into a hydrothermal system, gas-rich aqueous fluids can exert a major control on geothermal energy production, can be propellants in hazardous hydrothermal (phreatic) eruptions, and can modulate the dynamics of geyser eruptions. We collected pressurized samples of thermal water that preserved dissolved gases in conjunction with precise temperature measurements with depth in research well Y-7 (maximum depth of 70.1 m; casing to 31 m) and five thermal pools (maximum depth of 11.3 m) in the Upper Geyser Basin of Yellowstone National Park, USA. Based on the dissolved gas concentrations, we demonstrate that CO2 mainly derived from magma and N2 from air-saturated meteoric water reduce the near-surface saturation temperature, consistent with some previous observations in geyser conduits. Thermodynamic calculations suggest that the dissolved CO2 and N2 modulate the dynamics of geyser eruptions and are likely triggers of hydrothermal eruptions when recharged into shallow reservoirs at high concentrations. Therefore, monitoring changes in gas emission rate and composition in areas with neutral and alkaline chlorine thermal features could provide important information on the natural resources (geysers) and hazards (eruptions) in these areas.