  The magnetic fields that emerge from beneath the solar surface and permeate
the solar atmosphere are the key drivers of space weather and, thus,
understanding them is important to human society. Direct observations, used to
measure magnetic fields, can only probe the magnetic fields in the photosphere
and above, far from the regions the magnetic fields are being enhanced by the
solar dynamo. Solar gamma rays produced by cosmic rays interacting with the
solar atmosphere have been detected from GeV to TeV energy range, and revealed
that they are significantly affected by solar magnetic fields. However, much of
the observations are yet to be explained by a physical model. Using a
semi-analytic model, we show that magnetic fields at and below the photosphere
with a large horizontal component could explain the $\sim$1 TeV solar gamma
rays observed by HAWC. This could allow high-energy solar gamma rays to be a
novel probe for magnetic fields below the photosphere.
