A test particle description of the runaway dynamics is used to analyze some of the main mechanisms limiting the runaway energy in a tokamak plasma. It is found that the synchrotron radiation losses associated with the electron gyromotion around the magnetic field lines can explain the energy limit of runaway electrons found experimentally by observing their bremsstrahlung spectra during the current ramp-up of low density Ohmic discharges in the Joint European Torus (JET) [Nucl. Fusion 25, 1011 (1985)]. The model is applied to the problem of determining the influence of a resonance between the electron gyromotion and the magnetic field ripple of the tokamak on the radiation loss and energy limits of runaway electrons. The equilibrium energy at the resonance and the conditions under which the ripple mechanism can create an upper bound on the runaway energy are investigated. Predictions are discussed on the effect of the ripple resonance on the maximum energy attainable by disruption generated runaway electrons in JET and the projected International Thermonuclear Experimental Reactor (ITER) [ITER EDA Agreement and Protocol 2, International Atomic Energy Agency, Vienna, 1994]. © 1999 American Institute of Physics.