When do we decide it’s OK to tell a lie? Perhaps when we see people in positions of power doing the same. A new study finds that individuals are more likely to lie if they live in a country with high levels of institutional corruption and fraud—suggesting that poorly run institutions hurt society in more ways than previously suspected.

Past research has shown that people are more likely to break the rules if those around them are also doing so. For instance, people surrounded by graffiti and litter are more likely to drop trash themselves. “But what we really don’t know is to what extent societal norms like political fraud, corruption, and tax evasion trickle down—and to what extent such societal norms corrupt individuals,” says Shaul Shalvi, a behavioral scientist at the University of Amsterdam who was not involved in the work.

To find out, researchers pulled data on government corruption, tax evasion, and election fraud from the World Bank and Freedom House, a nongovernmental organization that researches democracy and political freedom, for 159 countries. They combined these rates into an index that measured institutionalized rule-breaking.

Then, over the course of almost 5 years, they traveled to 23 of those countries to measure honesty at the individual level. They asked college-aged volunteers to roll a die and report the number that came up. The higher the number, the more the researchers paid the participants—but participants knew the experimenters couldn’t see the results of their rolls. When the average number of the reported die rolls from all the participants in one country turned out to be greater than expected by chance, the researchers knew that some people were lying to get more money. When they compared these rates with institutionalized rule-breaking, they found that people in countries with higher levels of rule-breaking were more likely to cheat on the task, they report today in Nature.

But when people lied, they rarely did so to the fullest extent possible. Rolling a five would win participants the maximum payout, because a six was worth nothing. But rather than just reporting that they had rolled a five, they were more likely to report only modestly inflated values like threes and fours. “Even faced with these temptations, people still care about feeling honest,” Shalvi says. “That’s why people lie only to the extent that they can justify their lies.”

Jonathan Schulz, an experimental economist at Yale University who co-authored the study, refers to this phenomenon as “justified cheating”—a way to benefit while still feeling like a somewhat honest person. What people justify as honest seems to vary according to their environment, Schulz says. “It seems that people benchmark their dishonesty with what they’re surrounded by in their daily life.”

The countries with the lowest rates of cheating tended to be well-off western European ones—Austria, the Netherlands, and the United Kingdom scored particularly low. On the other hand, Morocco, Tanzania, and Kenya scored among the highest.

Financial instability might help explain why cheating is more prevalent in certain countries, other researchers say. “If everyone around you is poor or desperate and scrambling for the next dollar, you might think that what matters is money, not adhering to high-minded rules,” says David Hugh-Jones, an experimental economist at the University of East Anglia in Norwich, U.K., who was not involved in the work. However, he cautions that using just one measure of honesty could skew results. For instance, gambling (as participants were asked to do here) is taboo in some societies. That could impact their choices on the task in ways unrelated to their intrinsic honesty.

While Schulz acknowledges that it’s tempting to conclude from the data that people in certain countries are intrinsically less honest, he instead sees cross-cultural commonality. “Even in the most corrupt countries, people are not blatantly dishonest,” he says. “People are concerned about this self-image of being an honest person.”