What is the name of your state (only U.S. law)? Washington
Suppose that I am in a car with a friend, and he gets pulled over. The police officer asks if he can search the car, and my friend agrees. I am sitting in the front, with a backpack that I would prefer not be searched. Is the cop entitled to search my backpack because it's in my friends car, and my friend agreed to a search? Can I take the backpack with me when I get out of the car and ask that it not be searched? Can a cop use denying a search as probable cause for a search?
I'm just curious about this. If there are any big cases on this, I would love to hear about them. Thanks!
Given that officer asked for permission to search it implies no probable cause. In order to potentially prevent a search of your belonging you would need to speak up at that point and say, "I do not consent to searches of my property". The cop might search it anyway, and might call a K9 unit, or might invent probable cause in the course of searching the vehicle they have permission to search or a surface inspection of your bag.
If the cop merely searches anyway you can have any evidence from your bag thrown out. If either the K9 is claimed to have hit on the bag, or the cop simply invents probable cause, the evidence stands. Probable cause can even be invented by something as simple as what the law calls "Furtive Movement", such as a movement to conceal some aspect of your bag. More than a few judges accept very general claims of "Furtive Movement". But legally "Furtive" means secretive or concealing, and requires a totality of circumstances, which judges usually also allow a very expansive interpretation of.
These legal limits on officers do not always prevent the officer from taking action. They are more generally relevant in what evidence is allowed to be used against you in court. So it's not that uncommon for an officer to take you to jail on charges they know can't stick for whatever reason. Often to teach you an attitude lesson about their authority. Without proper representation, or an overabundance of willingness to simply plead guilty, even improper arrest can get lots of convictions.
If, on the other hand, you can demonstrate a clear violation that's not encumbered by claims of furtive movement, claims that the search was consensual, etc., etc., they can be sued. Given that you even asked this question the last thing you need to do is verbally spar with the officer about the law. You may choose to say "I don't consent to a search of my property", then shut up and let the officer do what they do. Then let your lawyer have it. The non-consent is a tool for your lawyer.
---
All else being equal, without any other probable cause, your rejection of consent to search legally prevents the search of your bag. Even if it is in a car for which they have consent to search. The realities of the situation is far more complicated.
To understand how intimidation works, and can be cut short, watch this video.
https://www.youtube.com/watch?v=U9SRS8X2Kww
Note how the cop says quiet loudly "GIVE ME THE BAG... PLEASE". To which the guy was essentially intimidated into giving him the bag. Only, legally speaking, this was a request, not an order. Hence, offering the bag without objecting to a search was effectively consent to search. That's when you see the camera guy speak up and totally changes the dynamic of the situation, and the cop drops the bag and discontinues the search.