Searches for primordial gravitational waves have resulted in constraints in a large frequency range from a variety of sources . The standard Cosmic Microwave Background ( CMB ) technique is to parameterise the tensor power spectrum in terms of the tensor-to-scalar ratio , r , and spectral index , n _ { t } , and constrain these using measurements of the temperature and polarization power spectra . Another method , applicable to modes well inside the cosmological horizon at recombination , uses the shortwave approximation , under which gravitational waves behave as an effective neutrino species . In this paper we give model-independent CMB constraints on the energy density of gravitational waves , \Omega _ { \textnormal { gw } } h ^ { 2 } , for the entire range of observable frequencies . On large scales , f \lesssim 10 ^ { -16 } \text { Hz } , we reconstruct the initial tensor power spectrum in logarithmic frequency bins , finding maximal sensitivity for scales close to the horizon size at recombination . On small scales , f \gtrsim 10 ^ { -15 } \mbox { Hz } , we use the shortwave approximation , finding \Omega _ { \textnormal { gw } } h ^ { 2 } < 1.7 \times 10 ^ { -6 } for adiabatic initial conditions and \Omega _ { \textnormal { gw } } h ^ { 2 } < 2.8 \times 10 ^ { -7 } for homogeneous initial conditions ( both 2 \sigma upper limits ) . For scales close to the horizon size at recombination , we use second-order perturbation theory to calculate the back-reaction from gravitational waves , finding \Omega _ { \textnormal { gw } } h ^ { 2 } < 1.0 \times 10 ^ { -6 } for 10 ^ { -15 } \text { Hz } \gtrsim f \gtrsim 3 \times 10 ^ { -16 } \text { Hz } .