A review by the shadow attorney general will examine whether the UK should exit certain domestic and international agreements.