Some impatient passengers may be in for a rude awakening the next time they try to line up early to get on a plane.

American Airlines has been piloting a system in recent weeks to flag when people attempt to board before their group has been called. Experts in human behavior say travelers who mass at the gate ahead of their turn do so out of a tendency to conform — and out of a sense of competition. Airline employees often refer to those passengers as “gate lice.”

American said that when someone tries to board with the wrong group, its software gives an “audible signal” and shows the gate agent a message with the correct group.

“We are in the early phase of testing new technology used during the boarding process,” American said in a statement provided to The Washington Post. “The new technology is designed to ensure customers receive the benefits of priority boarding with ease and helps improve the boarding experience by providing greater visibility into boarding progress for our team.”

The airline has tested the technology at the Albuquerque and Tucson airports and — pleased so far with the results — will expand soon to other locations, including Reagan National Airport near Washington, D.C.

Delta Air Lines does not use any boarding enforcement technology, but said it switched its system earlier this year to board by numbered zones “to bring more clarity” to the process. United Airlines said, “Our gate agents monitor the boarding process.”

American Airlines’ boarding process largely prioritizes travelers with status or those who have paid for front-of-plane seats. Those who pay for priority boarding are called in Group 4. Main cabin passengers board in groups 7 and 8, while the lowest-priced basic economy group goes last.

News of the American Airlines test has bubbled up on Reddit, where one poster deemed it “awesome,” and in travel blogs.

Gary Leff wrote about the topic last week for his site, View From the Wing, after a reader alerted him to the new system. He wrote that passengers who crowd the gate and get in line before their turn create a “more chaotic process.”

“Gate agents are busy and don’t always look at boarding groups when people scan their boarding passes,” he wrote. “This is simple, yet genius.”

In an interview with The Post, Leff said the airline sets its boarding process to encourage behaviors like signing up for its credit card or earning frequent-flier status. Readers were generally in favor of the stepped-up enforcement, he said.

“There’s very little pushback to the idea that people ought to board in their assigned order,” Leff said. “There is frustration from passengers when others don’t follow that norm.”

RECOMMENDED VIDEO