It’s covered by statute that Congress approved - with the 30 day advance notification proviso.
So, the thirty day advance notice would be time enough for Congress to discuss and kill the the idea of a trade. Senators would be asked their position on such a trade, guaranteed. It might not be in specific terms, but they would still be asked to go on record on any possibility of trading the five most dangerous prisoners for an American detainee.