Rioting is an act of participating in a violent public disturbance, which involves multiple individuals engaging in destructive activities. Such activities can include vandalism, theft from both public and private property, physical assaults on others, and looting. Riots can significantly harm both government and public property, resulting in losses of life, injuries, and property damage. Most of the time, it has been observed that private and public transport turned into the major targets of riots. By detecting potential threats and responding quickly, autonomous vehicles equipped with riot prevention features can help to prevent harm to both individuals and property during a riot. Moreover, riot threat-detecting features can contribute to minimizing the economic impact of riots, which is particularly important for businesses and communities that rely on tourism, trade, and commerce. Despite the development of various safety features in autonomous vehicles, there is currently a lack of effective measures to detect riots and violent public disturbances on roads and highways. In this study, we propose a solution for leveraging the You Only Look Once (YOLO) algorithm to detect six types of road objects and one class of threats for autonomous vehicles. The YOLO version 8 model was trained and assessed on a dataset of road objects including riot threats, and it achieved a maximum accuracy of 97.71%. Additionally, the proposed solution can be coupled with ground robots and unmanned aerial vehicles technology to enable real-time monitoring and treatment of chaotic and risky zones of riot.