Let's say I'm coming into the USA. A border guard says they want to inspect my digital devices. Can I refuse, turn around, and just not enter the USA ,get back on a plane, turn around and drive back, or do I have to give over my devices just because I showed up?
Can I refuse, turn around, and just not enter the USA ,get back on a plane, turn around and drive back, or do I have to give over my devices just because I showed up?
In theory you can refuse and turn around. At a highway check point or in a private boat disembarking context, that is fairly feasible. If you turn around before you are searched and get back across the border, the border control officers can't pursue you.
In a commercial airplane or commercial boat disembarking context, this is as a practical matter, not a very feasible thing to do, because you can't as a practical matter, turn around and even if you plan to return, the only way you can make it to a return trip without passing through customs is if the border control officer refuses to admit you.
The law is that non-probable cause searches are permitted at border checkpoints (and indeed even near a border checkpoint on the in country side), but this isn't much clarity about when that authority ends (short of returning across an international boundary) when deciding not to enter at a border checkpoint.
Also, there is also a split of authority over whether a cell phone search is allowed in the first place. The Second Circuit in the U.S. has held that it is not, but the law is unresolved in many U.S. states at this time.