The purpose of the blood–brain barrier is to protect against circulating toxins or pathogens that could cause brain infections, while at the same time allowing vital nutrients to reach the brain.