For those who take a sadistic pleasure in looking for evidence that we are creeping closer to a dystopian future where humans are ruled by their robot overlords, consider this possible nightmare scenario: Artificial intelligence is not only coming for your job but will have a hand in laying you off, too.

AI has already infiltrated multiple parts of the human resources process, from hiring to onboarding to training to evaluating. It’s not a huge stretch to think that in an efficiency-obsessed sector like technology, tools designed to streamline decision-making are now making their way into layoffs. The conditions here are ripe for it: Tech’s nearly 42,000 job cuts last month were the second highest on record for the sector, according to data from outplacement firm Challenger, Gray & Christmas Inc.

One of the reasons we know there’s a movement toward automating parts of so-called “workforce reduction” is because human resources executives have admitted to it: A report last month from Capterra, an arm of tech industry research firm Gartner Inc., found that 98% of the HR leaders it surveyed said they would at least somewhat rely on software and algorithms to reduce labor costs in a 2023 recession.

For hourly workers, management by algorithm is nothing new. In 2021, for example, Bloomberg News reported that Amazon.com Inc. was tracking every move of its Flex delivery drivers, some of whom were fired by automated email when the company’s algorithms decided the workers were falling down on the job. The information deluge that Amazon collects on these independent contractors is what makes it possible for algorithms to evaluate performance, but the volume of data also makes it easier for proponents of AI to argue that these tools are necessary; it’s far too many inputs for a human to possibly interpret.

Office workers have until recently escaped such intense scrutiny, in large part because the data to track them in the same way hasn’t existed. But that’s changing with the increasing popularity of the workforce productivity score, and the growing inclination and ability to closely monitor not just whether employees are in front of their keyboards but their every keystroke and mouse click.

To be clear, I’m not suggesting HR managers will simply push a button and out will pop a pile of pink slips (and along with that a whole bunch of legal and reputational issues), although it’s almost guaranteed someone will try. The greater likelihood is that AI helps narrow the pool and provides a first pass before a human gets involved — akin to what happens in the hiring process now.

This might seem like the holy grail for HR managers, a chance to remove the emotion from layoffs, and shift the blame and bad feelings from humans to machines. But we know that’s not how AI works. As the edict goes, bad data in, bad data out. And there’s plenty of evidence that the data companies already rely on for employee evaluations is far from perfect.

Capterra analyst Brian Westfall told me that while 70% of HR leaders say they would use performance metrics in layoff decisions, a higher percentage report that they are considering changing performance evaluations because they think the process is flawed. Even the HR leaders in the Capterra study who said they would rely on software and algorithms to cut labor costs in a 2023 recession were wary of the technology. Only half said they are completely confident that these tools will produce unbiased recommendations, while 47% reported being completely comfortable making layoff decisions based on these recommendations.

Rather than remove bias from a round of messy and uncomfortable layoffs, AI has the potential to encode it. Several experts pointed me to another Amazon example, in which the tech giant tried to build an automated tool to narrow down a pool of job applicants. Its engineers trained the system to look at the historical data on people who had submitted resumes in the past. But because tech is a male-dominated industry and most past candidates were men, women who applied for technical jobs were penalized by the algorithm. (Reuters reported that Amazon abandoned the program, with the company saying it never used the tool to evaluate candidates.)

It’s yet another case study of how AI has the potential to make us forget that human resources is about, well, humans. We are steadily marching toward a robotic apathy now, with reports of some tech employees being told by email that they had lost their jobs rather than by an actual person. Today we readily acknowledge that a layoff can be one of life’s most traumatic events. Somehow that doesn’t seem to square with turning such a devastating decision over to algorithms — especially when we readily acknowledge that we don’t really trust them.

Beth Kowitt is a Bloomberg Opinion columnist covering corporate America. She was previously a senior writer and editor at Fortune Magazine.