This is the only real solution...defang by making any federal enforcement official criminally liable in any case where a state's constution or the civil rights of its citizens are violated.
I mean arrested on the spot and given a speedy trial....then and only then will they drop the "I'm a federal agent and I can do anything attitude...".
The best defense is to develop and train a large enough jury pool to thwart prosecutors through nullification on gun issues.