If your child is four or older, and in your company, he or she may be more willing to respond to questions from strangers. It may take a little longer though, as your child weighs the situation in question against your rules. In these cases, don’t label your child as shy – rather give him or her an extra minute or two to formulate an answer.
If your child does not answer, then it’s okay (even in the etiquette rule books) for you to answer instead. That way, you’re still being polite, and not bending the rules about talking to strangers. You could even add that you have told your child not to talk to strangers by way of explanation – that’s perfectly acceptable.
The most important thing is that your child realises that it’s most important that he or she doesn’t talk to strangers when you’re not around – rather than worrying about whether he or she is polite.
Of course, older children are better equipped to deal with strangers questions – an eight year old, for instance, will be able to give a polite answer to a stranger’s question whether you are present or not, while your four year old is more likely to blurt out the first answer that he or she thinks of, and only in your company.