10 U.S. Code § 632 - Effect of failure of selection for promotion: captains and majors of the Army, Air Force, and Marine Corps and lieutenants and lieutenant commanders of the Navy
(a) Except an officer of the Navy and Marine Corps who is an officer designated for limited duty (to whom section 5596 (e) or6383 of this title applies) and except as provided under section 637 (a) of this title, each officer of the Army, Air Force, or Marine Corps on the active-duty list who holds the grade of captain or major, and each officer of the Navy on the active-duty list who holds the grade of lieutenant or lieutenant commander, who has failed of selection for promotion to the next higher grade for the second time and whose name is not on a list of officers recommended for promotion to the next higher grade shall—
(1) except as provided in paragraph (3) and in subsection ©, be discharged on the date requested by him and approved by the Secretary concerned, which date shall be not later than the first day of the seventh calendar month beginning after the month in which the President approves the report of the board which considered him for the second time;
(2) if he is eligible for retirement under any provision of law, be retired under that law on the date requested by him and approved by the Secretary concerned, which date shall be not later than the first day of the seventh calendar month beginning after the month in which the President approves the report of the board which considered him for the second time; or
(3) if on the date on which he is to be discharged under paragraph (1) he is within two years of qualifying for retirement under section 3911, 6323, or 8911 of this title, be retained on active duty until he is qualified for retirement and then retired under that section, unless he is sooner retired or discharged under another provision of law.
The officer promotions AFI also references sanctuary multiple times for AD officers.
3.10. Effects of Nonselection for Promotion. Generally, officers not selected for promotion to captain through lieutenant colonel for the second time are separated in accordance with AFI 36- 3207, Separating Commissioned Officers, unless they: 3.10.1. Are retirement eligible or within 2 years of qualifying for retirement (i.e., in the sanctuary) as of the mandatory date of separation (DOS) established for officers twice nonselected for promotion by that board.