The 4-foot line and the surcharge rule
A San Francisco wall up to 4 feet tall, measured from the bottom of the footing, with nothing above it but soil, generally needs no building permit. Add a driveway, building or slope above it, or go taller, and DBI requires a permit and a licensed engineer's design.