; (B) creating safe spaces and facilities for LGBTI aliens; (C) confidentiality requirements; and (D) nondiscrimination policies. (f) Limitation on detention (1) Presumption of release (A) In general Notwithstanding any other provision of law and except as provided in subparagraphs (B) and (C), the Secretary of Homeland Security— (i) may not detain an alien who is a member of a vulnerable group under any provision of the Immigration and Nationality Act ( 8 U.S.C. 1101 et seq.) pending a decision with respect to whether the alien is to be removed from the United States; and (ii) shall immediately release any detained alien who is a member of a vulnerable group. (B) Exceptions The Secretary of Homeland Security may detain, pursuant to the Immigration and Nationality Act ( 8 U.S.C. 1101 et seq.), an alien who is a member of a vulnerable group if the Secretary makes a determination, using credible and individualized information, that the use of alternatives to detention will not reasonably assure the appearance of the alien at removal proceedings, or that the alien is a threat to another person or the community. The fact that an alien has a criminal charge pending against the alien may not be the sole factor to justify the detention of the alien. (C) Removal In a case in which detention is the least restrictive means of effectuating the removal from the United States of an alien who is a member of a vulnerable group, the subject of a final order of deportation or removal, and not detained under subparagraph (B), the Secretary of Homeland Security may, solely for the purpose of such removal, detain the alien for a period that is— (i) the shortest possible period immediately preceding the removal of the alien from the United States