Ultimately if you teach her to stay away from boys then that will probably end up with her either hating them or completely rebelling against you.
I think what you want to achieve is better done by giving her the linguistic tools to say what needs to be said and to whom it needs to be said. If she doesn't like the way someone touches her, her body is absolutely her body and it is completely right for her to leave the situation/push the person away/ do whatever it takes to keep herself safe.
You see there are plenty of girls who feel a mountain of pressure from society and their peers to do things that they really are either not ready to do nor actually want to do. And that is where you can help now, by teaching her to value herself, that she doesn't need to impress anyone, that if anyone says to her "if you love me you'll..." they don't give the slightest ... about her, for example.
It's about who she is now.
If you're worried about adults abusing her, then that needs to be helped by you knowing what's going on in her life, as many adults who do this are very good at getting the trust of children and making them feel special and valued before the abuse starts so the child's silence is guaranteed.
Now if you're worried about your daughter getting attacked, telling her to keep away from boys won't help so much as actually making sure you can help her make good choices. "Don't walk home alone late." "Don't be alone with boys you don't know." etc etc etc. You have to get her trust and explain the things are for her safety and throw in some life experiences from you and actually be vulnerable in front of your child.
Now is the time when she is probably the least at risk from her male peers. SO now is the time when you can introduce the language she needs and teach her about the dangers, what to look out for to make sure she doesn't have things happen to her that she doesn't want -- obviously and you know are bad too, but that's how to start it. Give her the skills now when it's easy so that later when she's not so under your jurisdiction she doesn't know how to handle herself around boys.