David Kirk was a career Marine pilot with a top-secret security clearance and a record of flying classified missions. He was in the cockpit when President George W. Bush and Vice Presidents Dick Cheney and Joe Biden traveled around the nation’s capital by helicopter.

With credentials like that, Kirk was stunned to fail a lie detector when he applied for a pilot’s job with U.S. Customs and Border Protection, which guards 6,000 miles of border with Mexico and Canada. After two contentious polygraph sessions that lasted a combined eight hours, Kirk said, he drove home “with my tail between my legs,” wondering how things had gone so wrong.