Sorry, I was a little too precise, the regs just say "crew", however the pax are far more at risk from the flight crew. One could argue that the fact that screening occurs causes the aberrant pilot to resort to other means ie locking other pilot out of the cockpit, rather than using a weapon carried on board to incapacitate or eliminate the other pilot.
Either Pilot is quite capable of destroying the aircraft and everybody/thing in it without resorting to using a carry on weapon (or the one already on the flight deck) or by locking the other Pilot out.
The only security against flight crew is to make sure they are legitimate. The rest of the crew do this by default.
Rummaging through Flight Crew's bags looking for weapons whilst not giving a second glance at their ASIC is a sure sign of a bureaucracy gone mad!