Not a parent, but my 2 cents anyway.
I think Blast has it right - show that you can interact with strangers, but there's "typical" stranger small talk. Start that early, but have "don't talk to strangers" type rules until the kid's brain starts to really get some critical thinking skills - 8 or 9? I dunno, I'm not a pediatrician.
As far as your kids' liberties, well as a kid we had rules about how far to stray. I grew up on a cul d'sac so it was pretty easy, and low traffic. But my grandmother's house was in east LA (picture the pasty white kid with his pasty white brother in a crowd of nicely-tanned kids). There were boundaries there too. Within those boundaries, play was OK. So we'd play with the other kids, and get to meet their parents that way. Allowed us to start learning "stranger" meeting with a lot less risk. After all, almost all of the media reports, it's a non-parent doing these things. Going to various parks and talking to other kids help too. Obviously parents of classmates. I think it's imperative that kids learn to talk to adults.
Another thing that probably helped, looking back, is my parents' social interactions. Monthly bunco for mom, weekly band practice for my dad. So I grew up around adults. Plus my best friend's family usually was over (or we were there) at least once monthly.
I can't really recall ever having a sit down with my parents on "not talking to strangers." Even at the Coliseum in LA (where the '84 Olympics were), it was just unspoken that we'd stay close. Later, in my pre-teens and early teens, going to Chinatown or Olvera Street with family there wasn't a lot of verbal instruction. However, the few times something was suspcious, mom made a deal out of it (body language more than anything, but easy enough to catch the signals at that age). Learned a lot about inner-city situational awareness from that.