For highly autonomous vehicles, human does not need to operate continuously vehicles. The brain-computer interface system in autonomous vehicles will highly depend on the brain states of passengers rather than those of human drivers. It is a meaningful and vital choice to translate the mental activities of human beings, essentially playing the role of advanced sensors, into safe driving. Quantifying the driving risk cognition of passengers is a basic step toward this end. This study reports the creation of an fNIRS dataset focusing on the prefrontal cortex activity in fourteen types of highly automated driving scenarios. This dataset considers age, sex and driving experience factors and contains the data collected from an 8-channel fNIRS device and the data of driving scenarios. The dataset provides data support for distinguishing the driving risk in highly automated driving scenarios via brain-computer interface systems, and it also provides the possibility of preventing potential hazards in some scenarios, in which risk remains at a high value for an extended period, before hazard occurs.