Americans are concerned about some of the corporate practices that put people at risk: Mining and selling data in ways that compromise privacy. Using facial recognition software that leads to biased decisions. Sourcing materials from countries with few environmental or labor protections.

That’s one reason why companies are putting more explicit emphasis on their ethical standards both publicly and internally.

But how they formalize their commitment to ethics varies widely. There’s no hard data, but many Fortune 500 companies now have a c-suite role that deals explicitly with ethics, said Patricia Harned, CEO of the Ethics & Compliance Initiative.

Some companies separate the function under the title chief ethics officer, chief integrity officer, chief trust officer or vice president of business conduct. But most commonly they’ll have a chief ethics and compliance officer.

Compliance is all about making sure a business adheres to rules, regulations and laws. That certainly can overlap with ethical concerns. Following the law – and just as important, its spirit – is considered the right thing to do.

But ethics has fewer bright lines than compliance, since it often deals with actions and technologies that are not legally restricted. Ethical behavior is more about corporate values, customer trust and respecting changing social norms.

Some companies don’t have any formal ethics role.

“It’s the job of the CEO to be chief ethics officer – you know, given the scale at which technology impacts society. … But I think ethics needs to come at all layers of the organization,” said Google CEO Sundar Pichai, in an exclusive interview with CNN’s Poppy Harlow.

But a corporate ethics program is stronger when there is someone whose job it is to make sure the business and its leaders adhere to the company’s stated ethical standards, said Gerry Zack, CEO of the Society of Corporate Compliance and Ethics.

And the CEO will play a pivotal role in the success or failure of any ethics program. “The CEO is the chief ethics example, the chief person people look up to as a role model,” Zack said.

So what do ethics officers actually do?

Helping a company’s leaders and its employees avoid doing the wrong thing – even if it isn’t technically illegal – is the province of chief ethics officers.

Their duties include making sure there are ethical standards in place and that everyone – particularly managers – is educated about those standards.

“Behavior in an organization is driven by people’s perception of how important integrity is at the company,” Harned said. “What drives that perception is the tone from the top and the behavior of your supervisor.”

Ethics officers also work with other departments to set up a system for reporting alleged ethics and compliance violations that employees can use without fear of retaliation.

And they help senior leaders set a good ethical tone, publicly encourage reporting of problems and hold accountable those who violate the company’s standards, even if the person in violation is the CEO or other senior executive.

That’s why they also should have a reporting relationship to the board and be able to meet with them privately without the CEO or general counsel present.

The goal: Find, fix and prevent problems

On a good day, ethics officers will identify potential ethical problems in an organization before they blow up.

Welcoming employee questions of all kinds is one way to do that.

“It’s much easier to say that’s not really a good idea than to have it turn up in an audit or have it reported,” said Samantha Kelen, chief ethics and compliance officer for Cardinal Innovations Healthcare and former lead ethics analyst at Duke Energy.

A lot of Kelen’s time is spent building relationships with leaders across the company so that she is looped into decisions that have ethical and compliance implications.

“This job requires people skills. It’s not just about knowing the law or knowing the rules. So much is based on negotiation and influence and creating trust,” she said.

She’ll ask senior managers what keeps them up at night, so she can help them head off problems at the pass, or at least contain them.

That, combined with educating and training employees in ethics and compliance, can not only avert reputation-damaging crises for the company. It also can minimize federal penalties when employees do break the law or violate regulations.

If a company’s ethics and compliance program works well, its controls will ferret out and stop the misconduct, Kelen said. “It may have occurred, but you caught it first and you self reported it.”

Or the company may be able to prove to federal authorities that the employees at fault had been trained in company policies but chose to go rogue.

Because at the end of the day, Kelen said, “We can’t stop everything.”