You've been stopped for a having a burned out taillight, and suddenly the officer asks you to give consent for a vehicle search. Is this legal?
Search and seizure
Does an officer have the authority to search your vehicle? Yes, and there are three common ways a search is conducted.
Consent: In this case the officer asks permission to search your car. You can say no, and saying nothing and remaining silent is not consent and the officer should not interpret it as such. If you consent, the officer can search your entire car, including locked compartments.
Reasonable suspicion: If you are suspected of concealing illegal items or weapons, the officer can search your car without your consent under reasonable suspicion. Officers are trained to look for body language or evidence that things aren't what they appear.
Search warrant: If you do not give consent the officer may call for backup and have another officer with a search warrant sent out. The search warrant is a particularly undesirable option resulting in a comprehensive search of your vehicle. At this point you have tried the officer's patience and their good will is likely to be exhausted.
If your car is impounded officers have a right to search the impounded car. Anything taken will be documented in an inventoried list.
These situations differ and the possibility for mishandling the law does exist. With an estimated 100 million traffic stops happening each year, there are plenty of chances for mistakes. Officers in the field have little time to consider all the options. Even a lapse in judgment backed by solid reasoning is likely to be faced with tolerance by the judicial system.
If evidence is collected against you during a traffic stop where the officer made a mistake will it be used in court? It's possible. In many cases if the officer acted reasonably the evidence will be included. Officers are given the benefit of the doubt, but their actions are still subject to review.
If you're pulled over, stay calm and remain polite even if you feel your rights have been violated. Escalating the stop to a combative situation will not help your case. Remember, you can always exercise your right to ask for an attorney.