From Google to Microsoft and now Amazon, the largest technology companies are increasingly seeing their ­workers protest their government projects.

In recent years, tech firms have built artificial intelligence and cloud computing systems that governments find attractive. But as these companies take on lucrative contracts to furnish state and federal agencies with these technologies, they’re facing increasing pushback from their staffs.

Amazon employees have joined civil rights groups and investors in protesting the company’s sale of facial recognition technology to law enforcement agencies. ­Amazon began marketing a facial recognition system, called Rekognition, to law enforcement as a means of identifying people suspected of committing crimes, shortly after the tool was introduced in 2016.

The system — which analyzes images and videos and compares them with databases of photos to pick out individuals — has been used by the Orlando Police Department and the Sheriff’s Office in Washington County, Ore.

In a letter addressed to Amazon Chief Executive Jeff Bezos, employees wrote:

“We refuse to contribute to tools that violate human rights. As ethically concerned ­Amazonians, we demand a choice in what we build, and a say in how it is used.”

The letter also criticized the data science company Palantir’s use of Amazon’s cloud computing systems to carry out work for Immigration and Customs Enforcement (ICE).

Amazon declined to comment but pointed to a blog post published on its website this month after the ACLU called for Amazon to ban the sale of Rekognition to police. Matt Wood, general manager of artificial intelligence at Amazon Web Services, wrote:

“We believe it is the wrong approach to impose a ban on promising new technologies because they might be used by bad actors for nefarious purposes in the future. The world would be a very different place if we had restricted people from buying computers because it was possible to use that computer to do harm. The same can be said of thousands of technologies upon which we all rely each day. Through responsible use, the benefits have far outweighed the risks.”

Earlier this week, 100 Microsoft employees wrote a letter to Chief Executive Satya Nadella protesting the software maker’s work with ICE. Microsoft holds a $19.4 million contract with ICE for a project relating to data processing and artificial intelligence. The letter now has 300 signatories.

With government contracts so lucrative, the question is whether employees’ concerns will push tech executives to action. Early signs suggest they may — at least to a degree.

The campaigns at Amazon and Microsoft echo one by Google employees. Workers there sought to halt an artificial intelligence project that Google was working on with the Pentagon that used machine learning to improve the accuracy of drone missions.

The protest was successful. Google said the Defense Department contract would not be renewed and created a set of principles to guide its artificial intelligence projects. The guidelines prohibit the kinds of work that could cause injury or violate human rights.