"My heart was beating wildly, but I managed to pull the cord and set off the alarm," she says. "It made such a loud noise the two men ran away."
These Safe Shorts incorporate a lock and alarm that also activates when someone tries to remove the garment by force.
Safe Shorts founder Sandra Seilz says her own experience prompted her to develop the product. Returning from a run she was accosted by three men, she says, one of whom tried to pull off her leggings while the other held her down.
"You can imagine what the intention of the third man was," says Ms Seilz. "But I was lucky. A man set his dog on them and the three men ran away."
Assaults such as these are all too common for many women around the world, prompting many companies to come up with personal gadgets aimed at warding off attacks and alerting others.
"Vendors usually come from a crowdfunding background typically with very similar product functionality," says Rishi Kaul, a research analyst for consultancy Ovum.
"You click a button on the device and your GPS location is sent to preselected contacts, sometimes with an accompanying siren."
For example, Safer, developed by Indian start-up Leaf Wearables, sells a pendant that doubles as a panic button. It is controlled by an accompanying smartphone app.
Tanya Gaffney, 24, found it useful when walking to meet a friend in New Delhi, India, one evening.
"I felt someone walking behind me and it just felt suspicious. Every lane I turned into he took the same turn which made me panic," recalls Ms Gaffney. "I was hoping to find a female figure or cop."
But nobody was around.
She sent an alert to her chosen group of "guardians" - her parents and two close friends - by pressing the back of her smart pendant twice.
"Luckily, the first person to call me was my friend who I was on my way to meet at the market. He told me he was tracking me via GPS and that he was on his way to get me," she says.
The man following her eventually took a different turn, but "the feeling of panic still terrorises me to this day," she says.
Image captionNimb co-founder Kathy Roma was the victim of a serious violent assault Image captionNimb's smart ring is actually a panic button and alert service
Similarly, Nimb is a smart ring incorporating a panic button that sends an alert and your location to chosen recipients. The alert can also be forwarded to the emergency services.
Nimb co-founder Kathy Roma was also a victim of crime 17 years ago. A man tried to strike up a conversation with her and stabbed her in the stomach when she didn't reply. Seriously wounded, she looked for help in a nearby building. She believes having a personal alert device would have brought help sooner.
Other devices include Revolver, which enables users to "check in" and let loved ones or friends know you've arrived home safely with a single click. Three clicks sends a "help" alert.
And at the more sophisticated end of the market, Occly has developed Blinc, a wearable security device that includes a "bodycam" to record video evidence of an attack, as well as setting off a siren, flashing lights and a call for help.