Decision-making processes face the dilemma of being accurate or faster, a phenomenon that has been described as speed–accuracy trade-off in numerous studies on animal behaviour. In social insects, discriminating between colony members and aliens is subject to this trade-off as rapid and accurate rejection of enemies is of primary importance for the maintenance and ecological success of insect societies. Recognition cues distinguishing aliens from nestmates are embedded in the cuticular hydrocarbon (CHC) layer and vary among colonies. In walking carpenter ants, exposure to formic acid (FA), an alarm pheromone, improves the accuracy of nestmate recognition by decreasing both alien acceptance and nestmate rejection. Here, we studied the effect of FA exposure on the spontaneous aggressive mandible opening response (MOR) of harnessed Camponotus aethiops ants presented with either nestmate or alien CHCs. FA modulated both MOR accuracy and the latency to respond to odours of conspecifics. In particular, FA decreased the MOR towards nestmates but increased it towards aliens. Furthermore, FA decreased MOR latency towards aliens but not towards nestmates. As response latency can be used as a proxy of response speed, we conclude that contrary to the prediction of the speed–accuracy trade-off theory, ants did not trade off speed against accuracy in the process of nestmate recognition.