Upvote:7
The security agents (the ones who scan your luggage and body pre-boarding) are Canadians and work for Canadian Air Transport Security Authority (CATSA). I'm sure they cooperate with the relevant U.S. authorities as required.
The pre-clearance folks (U.S. destinations only) are Americans and work for the Customs and Border Protection (CBP) agency of Homeland Security. They have limited powers while on Canadian soil and are unarmed, but can still ruin your day if so inclined.