We develop a flexible set of action-based distribution functions ( DFs ) for stellar haloes . The DFs have five free parameters , controlling the inner and outer density slope , break radius , flattening and anisotropy respectively . The DFs generate flattened stellar haloes with a rapidly varying logarithmic slope in density , as well as a spherically aligned velocity ellipsoid with a long axis that points towards the Galactic centre – all attributes possessed by the stellar halo of the Milky Way . We use our action–based distribution function to model the blue horizontal branch stars extracted from the Sloan Digital Sky Survey as stellar halo tracers in a spherical Galactic potential . As the selection function is hard to model , we fix the density law from earlier studies and solve for the anisotropy and gravitational potential parameters . Our best fit model has a velocity anisotropy that becomes more radially anisotropic on moving outwards . It changes from \beta \approx 0.4 at Galactocentric radius of 15 kpc to \approx 0.7 at 60 kpc . This is a gentler increase than is typically found in simulations of stellar haloes built from the mutiple accretion of smaller systems . We find the potential corresponds to an almost flat rotation curve with amplitude of \approx 200 kms ^ { -1 } at these distances . This implies an enclosed mass of \approx 4.5 \times 10 ^ { 11 } M _ { \odot } within a spherical shell of radius 50 { \mathrm { kpc } } .