Even as we slumber, our industrious brains continue working to keep us alive. They ensure our heartbeats and breathing remain on track, wash off the waste they've accumulated throughout the day, and sort and file our memories. Now it seems they achieve all this and more while also monitoring our surroundings for stranger danger, a new study suggests.

"Unfamiliar voices should not be speaking to you at night – it sets off an alarm," University of Salzburg cognitive neuroscientist Manuel Schabus told New Scientist.

Schabus and colleagues observed this brain alarm in 17 volunteers. After a night to adjust to the new surroundings of the sleep lab, volunteers underwent polysomnography to record their brain waves, oxygen levels, heart and breathing rates, and movements.

"We presented the participants with audios of their own names and two unfamiliar names. These names were spoken by either a familiar voice or an unfamiliar voice," the study's first author and cognitive neuroscientist Mohamed Ameen explained on Twitter.

Participants exposed to the softly played, unfamiliar voices displayed a greater response than those who did not. These responses included micro-arousals – brief bouts of wake-like brain activity that only last seconds. The function of micro-arousals is not yet completely understood.

While both familiar and unfamiliar voices triggered patterns of brainwaves called K-complexes, only those who heard unfamiliar voices experienced larger changes in brain activity related to sensory processing. K-complexes are thought to prevent you from waking in response to harmless disturbances.

"K-complexes may be the key mechanism shaping how we sleep, helping the brain decide if we should stay asleep or wake up," Schabus told Inside Science. "It's quite a smart mechanism that allows you to filter what's relevant or not, and when it is relevant, it will trigger a chain of processes facilitating the processing of that information without needing you to wake up and disrupt sleep."

Together, these findings suggest "the sleeping brain extracts relevant sensory information for further processing," Ameed said.

This adds to previous research suggesting sensory processing of our environments continues even as we're unconscious, with the brain entering a 'sentinel mode' to perform this processing.

"Our results pose unfamiliar voices as more relevant – or in evolutionary terms potentially more threatening – and consequently more arousing to the sleeper than familiar voices," the team wrote in their paper.

However, the researchers haven't ruled out that this more aroused response isn't just due to new voices being more attention attracting in general, rather than specifically perceived as a possible threat.

Yet, while the response to familiar voices didn't change after repeated exposure later in sleep, the brain's response to unfamiliar voices did. This suggests the brains not only processed but learned from new information during sleep, possibly deciding the unfamiliar but repeated noise was not a threat, dulling future responses to it.

These findings may help explain why we can find it hard to sleep in new environments at first – our brains require time to sort out all the unfamiliar sounds and determine we are indeed safe to remain relaxingly unaware.

This research was published in The Journal of Neuroscience.