Stop AIDS in Prison Act of 2017 This bill directs the Bureau of Prisons to develop a comprehensive policy to provide HIV testing, treatment, and prevention for federal inmates in prison and upon reentry. It amends the federal criminal code: to require an HIV test for each convicted federal offender sentenced to prison for any length of time regardless of risk factors, unless the individual declines; to make the HIV test part of the routine health screening conducted at intake; and to require a pre-release HIV test, unless the individual declines.