  We discuss whether an unaccounted contribution to the Cosmic Microwave
Background polarization $B$-mode by primordial magnetic fields (PMFs) can bias
future constraints on inflationary gravitational waves. As a case-study, we
consider a scale-invariant PMF spectrum with amplitude of
$\approx{1}\,{\mathrm{nG}}$ on $1\,\mathrm{Mpc}$ scales, compatible with
current cosmological bounds. We find a degeneracy in the $B$-mode spectra
between PMFs and inflationary gravitational waves. If PMFs of this amplitude
are not accounted for, future CMB experiments could claim a false detection of
a tensor-to-scalar ratio $r\approx 0.007$, close to the predictions of
Starobinsky and $\alpha$-attractor models. The degeneracy can be broken if
$B$-modes are measured also at multipoles $\ell\gtrsim 900$: more precisely
experiments like CMB-S4 or CORE-M5 would be able to discriminate PMFs from
primordial GWs at high statistical significance. Experiments like LiteBIRD or
PIXIE will not be able to break the degeneracy and will need complementary
bounds coming, for example, from measurements of anisotropies in the Faraday
rotation angle of CMB polarization. This reinforces the importance of future
experimental constraints on PMFs.
