Treaties can be withdrawn from. It is also possible to invoke one of the exceptions in the treaties. There is no court with jurisdiction to say otherwise, and so no problem in simply asserting that what we are doing is permitted. Finally, treaties can simply be ignored, the same way that the US ignores the Convention Against Torture, to which it is signatory.