As robots advance from the pages and screens of science fiction into our homes, hospitals, and schools, they are poised to take on increasingly social roles. Consequently, the need to understand the mechanisms supporting human-machine interactions is becoming increasingly pressing, and will require contributions from the social, cognitive and brain sciences in order to make progress. In this talk, we introduce a framework for studying the cognitive and brain mechanisms that support human-machine interactions, leveraging advances made in social cognition and cognitive neuroscience to link different levels of description with relevant theory and methods. Also highlighted are unique features that make this endeavour particularly challenging (and rewarding) for brain and behavioural scientists. Overall, the framework offers a way to conceptualize and study the cognitive science of human-machine interactions that respects the diversity of social machines, individuals' expectations and experiences, and the structure and function of multiple cognitive and brain systems.