Hoodmaps is a service that more generally allows labeling different neighbourhoods and 'areas' of a city. These labels are not primarily focused on 'perceived safety', and the quality greatly differs from city to city, but they can be an useful guide to check when getting acquainted with a city.
Note: The above image is not licensed under the CC license, it's a screenshot from Hoodmaps who holds the copyright to the image.
Link: https://hoodmaps.com/san-francisco-neighborhood-map
It's not likely that Google Maps, Apple Maps or similar apps would ever include a feature to avoid bad neighborhoods, because it could be labeled racist and attract lots of negative publicity.
In addition to doing manual research on dangerous areas of San Francisco, which is pretty easy, there's also an app called Augurisk Now, which should warn the user if they're potentially exposed to crime or natural hazards. YMMV, I've never used the app, just found it now via an article on Forbes.
Lately Google Maps has been telling me to make illegal left turns on Mission and Valencia, and even tried to send me down a one-way street (Page St. at Buchanan). Has anyone had similar problems with other faulty Google Maps directions? (I should note, I'm a journalist working on a story about this, want to gauge if there are any other problem spots).