Molecular basis for detection of invading pathogens in the brain