In theoretical physics, a gauge anomaly is an example of an anomaly: it is an feature of quantum mechanics—usually a one-loop diagram—that invalidates the gauge symmetry of a quantum field theory; i.e. of a gauge theory.
All gauge anomalies must cancel out. Anomalies in gauge symmetries lead to an inconsistency, since a gauge symmetry is required in order to cancel degrees of freedom with a negative norm which are unphysical (such as a photon polarized in the time direction). Indeed, cancellation occurs in the Standard Model.
The term gauge anomaly is usually used for vector gauge anomalies. Another type of gauge anomaly is the gravitational anomaly, because reparametrization is a gauge symmetry in gravitation.
Anomalies occur only in even spacetime dimensions. For example, the anomalies in the usual 4 spacetime dimensions arise from triangle Feynman diagrams.
In vector gauge anomalies (in gauge symmetries whose gauge boson is a vector), the anomaly is a chiral anomaly, and can be calculated exactly at one loop level, via a Feynman diagram with a chiral fermion running in the loop with n external gauge bosons attached to the loop where where is the spacetime dimension.