I dont think its too young. the earlier you start talking to her about it the better.
Our DD is 5 & i completely trust her with her food choices - even when she is at other peoples places. She understands the food groups that she cant have & if it is a food that she hasnt had before or doesnt recognise, she will always ask - is this safe for me?? she will often tell strangers or parents that we dont know very well that she cant have something 'cause it will make her get dead'.. LOL.. a bit of an exaggeration, but thats what works for her.
We jsut used to talk to DD about how she cant have XXX because it will make her sick/not be able to breathe whatever, but you can have YYY instead. we just have been very open about it her whole life (all 5 years of that. ha) & talk about it a lot. It is definitelly easier as they get older. We havent had any food accidents by her choosing a food that she cant have, but we have had food accidents by people giving her somethhing & telling her that it's OK, but it hasnt been - the person just hadnt checked properly. DD did the right thing & asked, but got told the wrong information sad