SAN FRANCISCO — In 2014, Google became one of the first technology companies to release a race and gender breakdown of its workforce. It revealed — to no one’s surprise — that its staff was largely white or Asian and decidedly male.

The company explained that it disclosed the figures, in part, because it wanted to be held accountable publicly for not looking “the way we wanted to.”

Since then, Google has made modest progress in its plan to create a more diverse workforce with the percentage of women at the company ticking up a bit. But a spate of recent incidents and lawsuits highlight the challenges the company has faced as it has been dragged into a national discussion regarding politics, race and gender in the workplace.

Google is being sued by former employees for going too far with its diversity effort. It is also being sued for not going far enough.

“My impression is that Google is not sure what to do,” said Michelle Miller, a co-executive director at Coworker.org, a workers’ rights organization that has been working with some Google employees. “It prevents the ability of a company to function when one group of workers is obstinately focused on defeating their co-workers with whatever it takes.”

The firing

The division within Google spilled into the open last year when James Damore, a software engineer, wrote a memo critical of its diversity programs. He argued that biological differences and not a lack of opportunity explained the shortage of women in leadership and technical positions.

Google fired Damore. He filed a lawsuit in January with another former employee claiming the company discriminates against white men with conservative views. In a separate lawsuit, a former recruiter for YouTube sued Google because he said he was fired for resisting a mandate to hire only diverse — female or black and Latino — candidates.

Google’s handling of the issue was also upsetting to Damore’s critics. In another lawsuit filed last month, a former Google employee said he was fired because he was too outspoken in advocating diversity and for spending too much time on “social activism.”

Inside Google, vocal diversity proponents say they are the targets of a small group of employees who are sympathetic to Damore. In some cases, screenshots of comments made on an internal social network were leaked to online forums frequented by right-wing groups, which searched for and published personal information like home addresses and phone numbers of the Google employees, they said.

Respect@

In 2015, Google started an internal program called Respect@, which includes a way for employees to anonymously report complaints of inappropriate behavior by co-workers. Some diversity supporters say other employees are taking advantage of this program to accuse them of harassment for out-of-context statements.

“Some people feel threatened by movements that promote diversity and inclusion. They think it means people are going to come for their jobs,” said Liz Fong-Jones, a Google engineer who is a vocal supporter of diversity.

Many big tech companies are struggling with the challenge of creating a more diverse workforce. In 2015, Facebook adopted the Rooney Rule. Originally used by the NFL to prod teams to consider coaching prospects who are black, the rule requires managers to interview candidates from underrepresented backgrounds for open positions. But last year, Facebook’s female engineers said gender bias was still a problem and that their work received more scrutiny than men’s work.

Even executives tasked with promoting diversity have had difficulties. In October, Denise Young Smith, who was Apple’s vice president of inclusion and diversity, came under fire when she said there was diversity even among 12 white, blue-eyed, blond men because they had different backgrounds and experiences. She later apologized saying she did not intend to play down the importance of a nonhomogenous workforce. She left Apple in December.

The tension is elevated at Google, at least in part, by its workplace culture. Google has encouraged employees to express themselves and challenge one another. It provides many communication systems for people to discuss work and nonwork related issues. Even topics considered out of bounds at other workplaces — like sharp criticism of its own products — are discussed openly and celebrated.

In January, on one of Google’s 90,000 “groups” — internal email lists around a discussion topic — an employee urged colleagues to donate money to help pay Damore’s legal fees from his lawsuit against Google to promote “viewpoint diversity,” according to a person who saw the posting but is not permitted to share the information publicly.

Some Google employees who are diversity advocates said management had not taken action against people who tried to bait them into making angry statements.

Lively debate

Last month, Tim Chevalier, who had worked at Google as an engineer until November, sued for wrongful termination, claiming he was fired “because of his political statements in opposition to the discrimination, harassment, and white supremacy he saw being expressed on Google’s internal messaging systems.” He said one employee had suggested there was a shortage of black and Latino employees at Google because they were “not as good.”

Chevalier said he had been fired shortly after saying that Republicans were “welcome to leave” if they did not feel comfortable with Google’s policies. He said he meant that being a Republican did not exempt Google employees from following the company’s code of conduct.

A Google spokeswoman said in a statement that the company encouraged lively debate. But there are limits.

“Creating a more diverse workplace is a big challenge and a priority we’ve been working to address. Some people won’t agree with our approach, and they’re free to express their disagreement,” said the spokeswoman, Gina Scigliano. “But some conduct and discussion in the workplace crosses a line, and we don’t tolerate it. We enforce strong policies, and work with affected employees, to ensure everyone can do their work free of harassment, discrimination and bullying.” In the past, discussions about diversity in Google’s online chat groups would encounter skeptical but subtle comments or questions. The debate turned openly antagonistic after Damore’s memo, which was titled “Google’s Ideological Echo Chamber.”

“The James Damore thing brought everything to a head,” said Vicki Holland, a linguist who has worked at Google for seven years. “It brought everything to the surface where everyone could see it.”

Damore said he began to question Google’s diversity policies at a weekly company meeting last March. At the meeting, Ruth Porat, chief financial officer of Google’s parent company, Alphabet, and Eileen Naughton, Google’s vice president of people operations, “pointed out and shamed” departments in which women accounted for less than half the staff, according to Damore’s lawsuit.

The two female executives — who are among the company’s highest ranking women — said Google’s “racial and gender preferences were not up for debate,” according to the lawsuit. Damore subsequently attended a “Diversity and Inclusion Summit,” where it reinforced his view that Google was “elevating political correctness over merit” with its diversity measures.

Damore said he had written his memo afterward in response.

‘Harmful gender stereotypes’

Scigliano, the Google spokeswoman, said the company looked forward to fighting Damore’s lawsuit in court. Sundar Pichai, Google’s chief executive, said in an August blog post that he had fired Damore because his memo advanced “harmful gender stereotypes” but that “much of the memo is fair to debate.”

Some employees said they were abstaining from internal debate on sensitive issues because they worried that their comments might be misconstrued or used against them. Like the broader internet, the conversations tend to be dominated by the loudest voices, they said.

Google’s diversity advocates said they would like to see more moderation on internal forums with officials stepping in to defuse tensions before conversations get out of hand. Miller, the Coworker.org co-director, said Google employees had expressed concern about how this would affect an internal culture rooted in transparency and free expression.

“What’s on everyone’s mind is: Has the culture been inextricably damaged by this environment?” she said.