The old gate rapes were easy to beat, and various techniques were legendary here on FT a while back. These days, a technique I use is to pick a line I suspect will have a lot of secondaries going on. I know it goes against the grain of every FT's mindset, but it works. Just pick the line with the young family, the wheelchair-bound person, or someone overflowing with jewelry or someone who you just know will set off the metal detector.
Now, if you're a victim, make sure you insist on keeping all of your stuff in your sight at all times, require anyone who touches the inside of your bags or you -- with dignity & respect of course -- to change gloves, and demand compliance with the Privacy Act if they assume they can copy down your personal information without your permission.
Don't roll -- push back.