The communication network of autonomous vehicles is composed of multiple sensors working together, and its dynamic topology makes it vulnerable to common attacks such as black hole attack, gray hole attack, rushing attack, and flooding attack, which pose a threat to the safety of passengers and vehicles; most of the existing safety detection mechanisms for a vehicle can only detect attacks but cannot intelligently defend against attacks. To this end, an efficient protection mechanism based on self-adaptive decision (SD-EPM) is proposed, which is divided into the offline phase and the online phase. The online phase consists of two parts: intrusion detection and efficient response. Attack detection and defense in the vehicular ad hoc networks (VANETs) are performed in terms of the attack credibility value (AC), the network performance attenuation value (NPA), and the list of self-adaptive decision. The simulation results show that the proposed mechanism can correctly identify the attack and respond effectively to different attack types. And, the negative impact on VANETs is small.