INA § 236, 8 U.S.C. § 1226.
Apprehension and detention of aliens
On a warrant issued by the Attorney General, an alien may be arrested and detained pending a decision on whether the alien is to be removed from the United States. Except as provided in subsection (c) of this section and pending such decision, the Attorney General—
(A) bond of at least $1,500 with security approved by, and containing conditions prescribed by, the Attorney General; or
The Attorney General at any time may revoke a bond or parole authorized under subsection (a) of this section, rearrest the alien under the original warrant, and detain the alien.
The Attorney General shall take into custody any alien who—
(A) is inadmissible by reason of having committed any offense covered in section 1182 (a)(2) of this title,
(B) is deportable by reason of having committed any offense covered in section 1227 (a)(2)(A)(ii), (A)(iii), (B), (C), or (D) of this title,
(C) is deportable under section 1227 (a)(2)(A)(i) of this title on the basis of an offense for which the alien has been sentence  to a term of imprisonment of at least 1 year, or
(D) is inadmissible under section 1182 (a)(3)(B) of this title or deportable under section 1227 (a)(4)(B) of this title,
when the alien is released, without regard to whether the alien is released on parole, supervised release, or probation, and without regard to whether the alien may be arrested or imprisoned again for the same offense.
The Attorney General may release an alien described in paragraph (1) only if the Attorney General decides pursuant to section 3521 of title 18 that release of the alien from custody is necessary to provide protection to a witness, a potential witness, a person cooperating with an investigation into major criminal activity, or an immediate family member or close associate of a witness, potential witness, or person cooperating with such an investigation, and the alien satisfies the Attorney General that the alien will not pose a danger to the safety of other persons or of property and is likely to appear for any scheduled proceeding. A decision relating to such release shall take place in accordance with a procedure that considers the severity of the offense committed by the alien.
(A) to make available, daily (on a 24-hour basis), to Federal, State, and local authorities the investigative resources of the Service to determine whether individuals arrested by such authorities for aggravated felonies are aliens;
(B) to designate and train officers and employees of the Service to serve as a liaison to Federal, State, and local law enforcement and correctional agencies and courts with respect to the arrest, conviction, and release of any alien charged with an aggravated felony; and
(A) to inspectors at ports of entry and to border patrol agents at sector headquarters for purposes of immediate identification of any alien who was previously ordered removed and is seeking to reenter the United States, and
The Attorney General’s discretionary judgment regarding the application of this section shall not be subject to review. No court may set aside any action or decision by the Attorney General under this section regarding the detention or release of any alien or the grant, revocation, or denial of bond or parole.