How coffee can keep workers honest

FORTUNE — As if you needed another reason to run out for another cappuccino, along comes a new study by three university professors suggesting that caffeine may help make the sleep-deprived more honest.

“Our research shows that sleep deprivation contributes to unethical behavior at work by making you more susceptible to social influences, such as a boss who tells you to do something deceptive,” says Michael Christian, a co-author of the study who teaches organizational behavior at the University of North Carolina’s Kenan-Flagler Business School. “Caffeine can help you resist by strengthening your self-control and willpower when you’re exhausted.”

The findings are important for managers, he adds: “We tend to think of people who work nonstop as the best employees. But they are often the ones making the worst ethical choices. It’s the people working the longest hours, and getting the least sleep, that managers need to keep their eye on.”

MORE: Welcome to the era of Lego innovation (some assembly required)

The research, published in the March issue of the Journal of Applied Psychology, built on a 2011 study of 171 hospital nurses who showed “increases in hostility and dishonesty, including theft, and decreases in self-control” after working long shifts without sleep, Christian said.

For this study — which, by the way, wasn’t sponsored by Starbucks — volunteers who had been kept awake all night were divided into two groups. All were asked to chew gum in the morning, but one group got a plain wintergreen placebo, while the other chomped on gum laced with 200 milligrams of caffeine, or about the same amount that’s in two cups of black coffee.

The participants were then put in situations where researchers “encouraged them to go along with a lie in order to earn some extra money,” Christian says. “We tried to replicate a situation where a boss or a peer was pressuring them to cut ethical corners at work.”

The results: Those who got the extra boost of caffeine consistently balked when researchers urged them to cheat, while those who were just exhausted — and had chewed the non-caffeinated gum — showed a marked willingness to cast conscience aside and go along with the deception.

Employers who want to reduce the likelihood of misbehavior should make sure people aren’t putting in too many long hours without a break and “avoid scheduling tasks that require a great deal of self-control when looming deadlines make long hours unavoidable,” the study concludes. Two other suggestions: Put in nap rooms at the office and don’t skimp on the free coffee.

MORE: Samsung okayed Apple attack ads 2 days after Steve Jobs died

“Our experiment doesn’t explain all of people’s decisions to do unethical things, but it is significant,” says Christian. He points to statistics from the National Sleep Foundation that show that most Americans say they sleep, on average, only about five-and-a-half hours per night. The clinical definition of sleep deprivation is anything under seven.

So are we less ethical than back in 1999, when most of us claimed to get at least seven hours of shuteye? Maybe not: Caffeine consumption is up, too. The National Coffee Association, a trade group of java producers and purveyors, said in its annual report last month that we’re gulping 18% more cappuccinos, lattes, and other espresso-based (read: strong) coffee drinks than we did in 2013.

Subscribe to Well Adjusted, our newsletter full of simple strategies to work smarter and live better, from the Fortune Well team. Sign up today.