Only you know what and when your child is ready to learn and how to best inform her. I can offer a test of what children would ideally know before they are ever alone in public. (I am noting just those points relevant to violence and sexual predation, and I am leaving out obvious requirements such as knowing one's home address, important phone numbers, and other basics.)
Take The Test of Twelve to determine if your daughter is ready to walk to school alone.
Plenty of adults couldn't themselves pass the Test of Twelve. For example, many have never even considered that if a predator says ''Don't yell,'' he is actually saying that yelling would serve you and silence would serve him. Too many people feel compelled to cooperate in their own victimization, in part because they assume they'll be hurt if they don't. When a predator says, ''Don't yell,'' he is telling you what cards you hold, literally informing you of the way to mess up his plans. ''Don't yell'' should be heard by a child as ''YELL.'' (A role-playing game to teach this skill will obviously be pretty fun.)
The corollary guideline is if someone says, 'Don't tell,' your child should hear ''TELL.''