  We describe how AGN-produced cosmic rays form large X-ray cavities and radio
lobes in the hot diffuse gas in galaxy groups and clusters. Cosmic rays are
assumed to be produced in a small shocked region near the cavity center, such
as at the working surface of a radio jet. The coupled equations for gasdynamics
and cosmic ray diffusion are solved with various assumptions about the
diffusion coefficient. To form large, long-lived cavities similar to those
observed, the diffusion coefficient must not exceed kappa = 10^28 cm^2/s in the
hot gas, very similar to values required in models of cosmic ray diffusion in
the Milky Way. When kappa does not exceed 10^28, cosmic rays are confined
within the cavities for times comparable to the cavity buoyancy time, as
implied by observations of X-ray cavities and their radio synchrotron emission.
Collisions of proton cosmic rays with thermal plasma nuclei followed by pion
decay can result in enhanced gamma ray emission from the cavity walls.
