The Yang-Mills gradient flow is considered on the four dimensional torus T^4 for SU(N) gauge theory coupled to N_f flavors of massless fermions in arbitrary representations. The small volume dynamics is dominated by the constant gauge fields. The expectation value of the field strength tensor squared is calculated for positive flow time t by treating the non-zero gauge modes perturbatively and the zero modes exactly. The finite volume correction to the infinite volume result is found to contain both algebraic and exponential terms. The leading order result is then used to define a one parameter family of running coupling schemes in which the coupling runs with the linear size of the box. The new scheme is tested numerically in SU(3) gauge theory coupled to N_f = 4 flavors of massless fundamental fermions. The calculations are performed at several lattice spacings with a controlled continuum extrapolation. The continuum result agrees with the perturbative 2-loop prediction for small renormalized coupling as expected.