We derive an expression for the angular power spectrum of cosmic microwave
background anisotropies due to gravity waves generated by a stochastic magn
etic field and compare the result with current observations; we take into a
ccount the non-linear nature of the stress energy tensor of the magnetic fi
eld. For almost scale invariant spectra, the amplitude of the magnetic fiel
d at galactic scales is constrained to be of order 10(-9) G. If we assume t
hat the magnetic field is damped below the Alfven damping scale, we find th
at its amplitude at 0.1h(-1) Mpc, B-lambda, is constrained to be B lambda <
7.9x10(-6)e(3n) G, for n < - 3/2, and B lambda<9.5x10(-8)e(0.37n) G, for n>
- 3/2, where n is the spectral index of the magnetic field and H-0 = 100h
km s(-1) Mpc(-1) is the Hubble constant today.