  We show that the sigma models with target spaces supersymmetric heterotic backgrounds with $SU(2)$ and $SU(3)$ holonomy are invariant under a W-symmetry algebra generated by the covariantly constant forms of these backgrounds. The closure of the W-algebra requires additional generators which we identify. We prove that the chiral anomalies of all these symmetries are consistent at one-loop in perturbation theory. We also demonstrate that these anomalies cancel at the same loop level either by adding suitable finite local counterterms in the sigma model effective action or by assuming a plausible quantum correction to the transformations. Such a correction is compatible with both the cancellation mechanism for spacetime frame rotation and gauge transformation anomalies, and the correction to the heterotic supergravity up to two loops in the sigma model perturbation theory. 
W-symmetries, anomalies and heterotic backgrounds with SU holonomy