The typical recommendation for feeding babies is to exclusively breastfeed for 6 months. but the purpose was mainly to reduce gastrointestinal infections.
Based on findings from the LEAP study, introduction of peanuts into the diet appeared to help build a better tolerance for peanuts than to have infants avoid it completely.
Based on findings from the EAT study, introduction of sufficient amounts of food allergens from 3-6 months appeared to be most beneficial in developing better tolerance.
Reference:
Modifying the infant’s diet to prevent food allergy