The non-linear self-regulation of cosmic ray acceleration at shocks