Section 412 of the final version of the anti-terrorism legislation, the Uniting and Strengthening America By Providing Appropriate Tools Required To Intercept and Obstruct Terrorism (H.R. 3162, the "USA PATRIOT Act") permits indefinite detention of immigrants and other non-citizens. There is no requirement that those who are detained indefinitely be removable because they are terrorists.
The Patriot Act defines "domestic terrorism" as activities within the United States that . . . involve acts dangerous to human life that. . . appear to be intended–
(i) to intimidate or coerce a civilian population;
(ii) to influence the policy of a government by intimidation or coercion; or
(iii) to affect the conduct of a government by mass destruction, assassination, or kidnapping. . . .