In December, Cisco csco U.K. vice president Eleanor Cavanagh-Lomas found a way to persuade a stubborn manager to change his approach to a reorganization after getting some fresh insight into how he views the world.

Her secret? Data analytics. Cavanagh-Lomas got advice on how to talk to the manager by logging in to Team Space, a web-based app built by Cisco engineers. There she can see an algorithm’s assessment of her 15 direct reports, based on a 15-minute multiple-choice test each one takes. The algorithm uses those selections to identify a hierarchy of nine “strengths” and then offers recommendations on how that person works best and what energizes him.

When Cavanagh-Lomas learned that this manager doesn’t give up easily, she acknowledged that quality in a conversation and asked him to try a different tack for a short time. If it failed, he could return to his method again. “The software gives you coaching tips tailored to their own style and how they need to hear feedback,” she says. It worked, she adds.

We’ve all heard of management by the book; welcome to management by the algorithm. “People analytics” is fast emerging as a tool in the perpetual war to retain and attract talent. Companies have started hiring data scientists and building or buying software that predicts who will leave and who will make the best senior vice president.

“It’s like Moneyball for HR, letting you make better decisions,” says Josh Bersin, principal at Bersin by Deloitte, the HR arm of the consulting giant, “and this year it has really peaked.” In the past 10 months, he says, the percentage of companies using predictive HR analytics has doubled, from 4% to 8%. Last year, investors put $2 billion behind companies making apps for hiring, performance management, even wellness. Bersin says he wouldn’t be surprised if HR teams soon begin intervening when employees who wear heart rate monitors show signs of stress.

Illustration by Harry Campbell

“It’s going to dramatically change the way we work,” says Ryan Hammond, head of people analytics at HiQ Labs, which uses external data from multiple sources to predict which employees are most likely to be poached. Started in 2012, HiQ has 25 Fortune 500 customers.

The HR apps run the gamut. For example, eBay ebay designed algorithms to reveal which workers might jump ship, using information on tenure, compensation, promotions, and feedback scores from managers. IBM ibm unveiled Blue Matching four months ago, using its Watson technology to connect thousands of employees with job opportunities. The software tallies data about each person’s role, skills, experience, location preference, and performance and then suggests openings for the employee.

General Electric ge is now testing machine learning to identify candidates for key promotions. Using HR data and profiles from a LinkedIn-style internal system, the software looks at correlations between the career paths of successful GE executives and others who have had similar jobs or leadership training. “We don’t do anything that would creep you out,” says James Gallman, GE’s strategic workforce planning leader. Executives handle the final vetting of candidates.

As we all know, technology isn’t always perfect. Using these apps requires particular care. For instance, relying only on past hiring data to build predictive algorithms could reinforce problems, says Hammond of HiQ. “Hiring discrimination, for instance, could get baked into your algorithms,” he says. Then there are the all-too-human factors—say, a sick child—that could affect performance without being counted in software inputs. Bersin describes a grocery chain that used software to uncover high turnover at several stores and then fired the manager. The turnover turned out to be seasonal and the dismissal unwarranted.

The apps also risk treading on employees’ privacy. Electronic badges can now use sensors to track who is talking to whom and register the tone of voice. Software can mine keystrokes and email activity. Laws don’t prevent companies from capturing such data, but transparency will keep employers from breaking their trust, argues Corey Ciocchetti, a law and ethics professor at the University of Denver. “Otherwise,” he says, “at some point it will backfire.”

Trust and transparency will be key as Cisco makes its Team Space app available to its 72,000 employees in coming months, says senior vice president Ashley Goodall, who leads the effort. He says Cisco designed the software to pinpoint the patterns, behaviors, and factors that add up to a successful team and a fruitful career. Leaders can use it to stay engaged with team members, see how their group stacks up against the best, and receive recommendations to improve. Already the software helped Cavanagh-Lomas spot an unhappy senior manager and adjust her role to keep her engaged. Otherwise, Cavanagh-Lomas says, the manager would probably have quit.

“Most of us are curious about how we can be better,” says Goodall. “This app understands who you are and how you’re going to be at your best. We think that’s going to give us an advantage in the marketplace.” 

A version of this article appears in the March 15, 2016 issue of Fortune.