There's a lot of interesting questions here. Constitutionally speaking (at the Federal level), there is an express right given to the Executive branch: "The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it." This situation would certainly fall under the latter condition.