San Rafael and Novato are in Marin County, which is generally very expensive. However, these are the largest cities. San Rafael is generally upscale, although there are some notorious parts of town such as the Canal Area.
https://en.wikipedia.org/wiki/Canal_Area,_San_Rafael,_California
Novato isn't that bad, but if you're working in San Francisco it's pretty far away. At least if you're living in San Rafael, there's easy access to Golden Gate Ferry.
Richmond has a reputation for high crime, although it's primarily surrounding the downtown area and some of the more notorious suburban areas. There was a notorious housing project there called Kennedy Manor that's since been torn down. The Point Richmond area across from the Chevron refinery is actually pretty nice. It started out as the "company town" for the old Standard Oil of California and it's actually pretty low crime. I grew up near Richmond, and saw its decline over the years. It all seemed to start when businesses started leaving downtown after Hilltop Mall (now considered a "ghetto mall") was built.
Close to Richmond there are lower crime areas such as most of El Cerrito, East Richmond Heights, Kensington, Albany, and most of Berkeley.