A new bill would make it illegal for federal law enforcement officials to have sex with people in their custody, targeting a legal loophole that has allowed authorities to claim that instances of alleged assault or rape were consensual.

California Rep. Jackie Speier, a Democrat, and Virginia Rep. Barbara Comstock, a Republican, introduced the bill to the U.S. House of Representatives on Thursday, their offices announced.

“This bill makes clear what should always be the legal standard — those in police custody should never be subject to sexual abuse or rape from law enforcement officers,” Comstock said in the statement. “It is common sense that those under arrest are legally incapable of consenting to sexual acts with officers who hold enormous power over them. We can never tolerate predators in any profession.”

The bill, called “The Closing Law Enforcement Consent Loophole Act,” was inspired by a BuzzFeed News story about an 18-year-old New York City woman who said she was raped by two police officers in 2017 while handcuffed in their custody. Because there was no law in New York preventing police officers from having sex with people in their custody, BuzzFeed reported, the men were able to claim the sex was consensual.

Both officers have since been fired and pled not guilty to sexual assault charges, BuzzFeed reports.

New York, along with several other states, has since made it explicitly illegal for officers to have sex with people in their custody.

Thirty-one states, however, still have loopholes like the one that existed in New York, according Speier and Comstock’s statement. The new bill would address that issue by making sexual acts between a federal law enforcement official and anyone in his or her custody punishable by a fine, up to 15 years in prison or both. The policy would also direct additional funding to law enforcement agencies in states that pass laws closing this loophole at the state level, and compel states to report complaints of sexual misconduct brought against officers.

Currently, there is no law that broadly prohibits federal law enforcement officials from using the consent defense in instances of alleged sexual assault involving people in custody, according to the representatives’ statement. It is, however, illegal for federal corrections officers to have sex with inmates.

“Law enforcement members wield incredible power in their ability to detain individuals,” Speier said in the statement. “Our bill ensures that police will act accordingly in their official duties, as befitting their role as officers of the law, and that any such abuse of this power will not be tolerated.”

It’s not clear when the new bill will be put to a vote.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Jamie Ducharme at jamie.ducharme@time.com.