The right of habeas corpus is set out in Article 9(4) of the International Covenant of Civil and Political Rights (ICCPR), of which the US is a signatory: "Anyone who is deprived of his liberty by arrest or detention shall be entitled to take proceedings before a court, in order that that court may decide without delay on the lawfulness of his detention and order his release if the detention is not lawful."
Unfortunately, the US Congress arrogates to itself the prerogative of labelling treaties as "non-self-executing," meaning that they have to be actually made effective by Congressional "enabling legislation," or not, as the whim of the Congress would have it. Hmm. Let's see how long such a "whim" or self-serving prerogative as this would hold up if another country, say Iran, decided to exercise it. We all know that such a case would immediately be referred to the Security Council for violations of international law.
The entire US Congress is now putting itself into a lawless state, and inviting any and all kinds of international lawlessness by its actions, unless measures are taken to counteract them. Wyden has helped provide the crucial margin of victory for this recklessness.