  The atmospheres of small exoplanets likely derive from a combination of
geochemical outgassing and primordial gases left over from formation. Secondary
atmospheres, such as those of Earth, Mars and Venus, are sourced by outgassing.
Persistent outgassing into long-lived, primordial, hydrogen-helium envelopes
produces hybrid atmospheres of which there are no examples in the Solar System.
We construct a unified theoretical framework for calculating the outgassing
chemistry of both secondary and hybrid atmospheres, where the input parameters
are the surface pressure, oxidation and sulfidation states of the mantle, as
well as the primordial atmospheric hydrogen, helium and nitrogen content.
Non-ideal gases (quantified by the fugacity coefficient) and non-ideal mixing
of gaseous components (quantified by the activity coefficient) are considered.
Both secondary and hybrid atmospheres exhibit a rich diversity of chemistries,
including hydrogen-dominated atmospheres. The abundance ratio of carbon dioxide
to carbon monoxide serves as a powerful diagnostic for the oxygen fugacity of
the mantle, which may conceivably be constrained by James Webb Space Telescope
spectra in the near future. Methane-dominated atmospheres are difficult to
produce and require specific conditions: atmospheric surface pressures
exceeding $\sim 10$ bar, a reduced (poorly oxidised) mantle and diminished
magma temperatures (compared to modern Earth). Future work should include
photochemistry in these calculations and clarify the general role of
atmospheric escape. Exoplanet science should quantify the relationship between
the mass and oxygen fugacity for a sample of super Earths and sub-Neptunes;
such an empirical relationship already exists for Solar System bodies.
