Prefix this with: not that this matters at all. There have been a number of recent instances of democrats moving to the Republican Party. From a procedural POV is there anything stopping a democrat from switching to the Green Party, PSL, or the like?
A thorough membership vetting process and democratic centralism. We study the history of COINTELPRO and other forms of state disruption so we can recognize the signs of infiltrators and act against them. Strong internal discipline.