I work in SF but don't live there, but over the past few years (especially under Chesa Boudin, the previous District Attorney) they've moved towards "soft on crime" policies that may have contributed to what friends who live there are referring to as 'lawlessness'
Some policies that likely have contributed include:
Bail Reform: They've prohibited cash bail, meaning most offenders who are arrested have no incentive to stand trial or prevent fleeing. No idea what the effect has been here, and as I understand it, offenders deemed violent are asked to forego bail. Again, no information on whether that's a voluntary ask or an imposed demand, but the impression is that people are arrested and back on the streets the same day to potentially reoffend.
Decriminalized theft up to $950: It is now quasi-legal to walk into a store in San Francisco, steal up to $949 in merchandise, and walk right back out. Allegedly, police won't respond to such incidents, and there's no deterrent from doing so. This has led to gangs who take turns, each walking in and snagging almost a thousand dollars worth of merchandise, then pooling the goods and reselling them. Pharmacies seem to have been particularly affected.
This was walked back somewhat, as shoplifting is now considered a felony again, especially if done as part of a ring, but police are apparently still extremely unlikely to respond.
Reduced sentences: Due to budgetary concerns, California as a whole is now imprisoning offenders for less time, issuing shorter sentences and early release as much as possible so that they do not have to bear the cost of imprisonment.
They defunded the police: Or, at least they pretended to? They promised to redirect $120 million of police funding away from law enforcement to support other social initiatives, and I remember a remark at the time that this was to fund reparation initiatives that they seem to be aiming to implement, but I have no idea as to the sincerity of that. That said, in the years since this promise, police budgets are up from where they were, so they seem to have either reversed course or possibly never gave it more than lip service. I'm not sure.
All together, if those are to be believed as causes (rather than say, wealth inequality, general social unrest, etc.) then it's worth looking into. Crime is up 110% in San Francisco relative to the American average, and is up 91% relative to the average in California.
Two additional notes: I'm just relaying what I think might have been OP's causes for attributing this to government action. I have no idea. I don't live there. Also, it seems that residents aren't particularly happy with it, as there was a (failed) attempt to recall Gavin Newsom, and a (successful) attempt to recall Chesa Boudin, and there are efforts underway to recall Mayor London Breed as well. No idea how that will fare.
Edit: It's probably worth remembering that someone can be stabbed anywhere, and if the fact that this happened in San Francisco confirms a bias you had, it's probably worth reframing it as somewhere else. Confirmation bias is our common enemy, and one that we don't have to succumb to just because our brains insist on it. Ask yourself if your tirade applies if you replace "San Francisco" with Zurich, Tokyo, Toronto, or Frisco Texas.