The UK and EU have agreed that either party withdrawing from their new food trade deal within its first 10 years would have to compensate the other for costs of restoring border controls and related infrastructure.