Chastity shorts
From wipipedia.org

Chastity shorts are shorts that cannot be removed by the wearer, hence force him or her to be chaste. They are generally made of leather (material) or rubber. Usually, they are kept on by a lockable belt and also have lockable straps arounf the ends of the legs.
While they would also work for females, they are normally worn by males.