I lived in SF 10 years and early on I was robbed at knife point just walking around The Mission district at around 7 PM (though it was dark because it was winter time).
I wasn't robbed but there was a person that burst out of the Victoria's secret downtown right in front of me.
My friend had her laptop stolen in the coffee shop I used to frequent, and while the thief was caught they could not recover any of the stolen stuff and she was eventually released.
Someone grabbed my iPhone out of my pocket (though I chased him down and forced him to return it).
Friend had parked a car in The Mission for their wedding held there. It was broken into and some wedding gifts including cash were stolen.
Friend had a guy "accidentally" open his back balcony door.
While working out of a pretty crowded Starbucks in the financial district some thugs came in and attempted a snatch and grab. He basically leaned in really quickly towards me but then apparently aborted when I braced and held the laptop. I wasn't even sure until the guy next to me told me after they left that they were planning to snatch it, and that one time he saw them do this and while trying to leave run full speed into a door that opened in-ward only.
I also for several years took the BART around midnight daily (after working out of a coffee shop downtown) so there's a long list of stuff I'm not even mentioning.
I think if you do short restricted trips to SF to nice areas, go with groups, take Ubers or your own car, etc, you can be pretty insulated. It wouldn't be hard to be sensible and take obvious precautions to greatly limit your exposure to crime. In fact, almost all of my friends who are there find it a great place to live because they basically do not have to interact with any of the undesirable parts or peoples of SF. I personally tried to take as much public transit (bus, walking, and BART) as much as I could, ate in The Tenderloin almost daily (and walked through it), and worked from public places frequently, so maybe I was asking for it but also I didn't want to give up the freedom to be able to do those things and not live some "alternate" city insulated life.
It's no wonder there's an anti-techie sentiment because the techies live on a complete different plane of existence here, never having to interact with the lower classes except when giving a tip, accepting a delivery, or writing a roommate rejection letter, and never having to interact with the public infrastructure that a whole class of people depend on and have no choice but to use. Some of my friends never had to leave the house except to go to work (delivery for food and groceries, Uber if they had to go somewhere specific). Yea if you can keep yourself in this bubble life is great; the city is great; the pay is great.
Of course, I did feel exhausted and left last year. If I wanted an insulated city life I'd have moved to the suburbs or LA. Planning to move to Tokyo as soon as they open up, where I can hopefully at least live in the city amongst the people, rather than above them.