The behaviour of halogens in subduction zones controls the exchange of chlorine and fluorine between the mantle and the oceans.