Former DARPA director and leader of secretive skunkworks divisions at Facebook and Google Regina Dugan said companies need to think about how using AI technology can go wrong in order to try to understand the ethical, societal, and legal implications of their work.

More specifically, she suggests technologists and engineers working with emergent technologies practice red teaming and blue teaming to imagine best and worst-case scenarios. Doing both allows you to consider how to mitigate negative consequences. Thinking in these terms should take place at the earliest stages in order for changes to have long-term impact.

“I think it’s impossible to know at any one point in time what all the unintended consequences will be,” Dugan said in an interview with Samsung Electronics president and chief strategy officer Young Sohn. “What are the bad things that could happen and what are the mitigating strategies? And then we look at those things in aggregate and make decisions about how to move forward, even in some cases with the responsibility to cut maybe some of the most positive outcomes in order to eliminate the most negative outcomes. That’s the balancing act.”

Dugan and Sohn spoke last week at the Samsung CEO Summit held at The Masonic in San Francisco, a one-day event subtitled “A Better World With AI.” Speakers also included former Google and Baidu executive Andrew Ng, as well as companies like Insitro, which wants to use AI for drug discovery, and Deep Instinct, which uses neural networks for cybersecurity.

She compared the optimism that AI will save us and fear that it will lead to the apocalypse to the emergence of the Human Genome Project in the 1990s. Back then, the National Institutes of Health took steps to encourage a continuous conversation and feedback from a wide range of disciplines, and the same should happen today with AI.

It’s also important, she said, that people consider themselves an active participant in what’s happening, not a bystander watching history from the sidelines.

“I think there’s a tendency to feel that when we get on a trend line like this, the future is going to unfold and that we are going to be passive observers of that future unfolding in front of us, but I have never actually experienced that,” she said. “What happens is we are active engineers and architects in the shaping of that future, and that means we have both the responsibility and a role in figuring out whether we’re asking the right questions and whether we are framing them up so that this technology can come to pass in the kind of world that we want to live in.”

In her interview, Dugan explained tactics used by DARPA and applied at companies like Google to create agile methods of experimentation and cutting-edge innovation with a number of university, startup, and government partners.

In addition to her time at DARPA, Dugan has been at the forefront of innovation for decades, serving as VP of engineering for Google’s skunkworks division Advanced Technology and Projects (ATAP) from 2012 to 2016, and founder of Building 8 at Facebook until October 2017. Last week the secretive skunkworks division at Facebook became the Portal team and unveiled the Portal and Portal+ video chat devices.

In the broad-ranging conversation, Dugan also addressed the tech industry’s persistent lack of progress when it comes to creating more diverse companies. In short, Dugan says, companies need to treat the lack of progress like a serious business problem.

For example, some estimates state that 41 percent of women leave jobs in tech after a few years.

“If you have a product quality problem or a manufacturing line that had a 59 percent yield, at some point you would not call for a networking lunch. That would not be the response,” she said. “Somebody would hit the big red button and there would be a war room and somebody would figure it out and create strategies and hypotheses about how to fix it, and then we’d measure the kind of output that we would have. And I’m certain that if you had a manufacturing line with 59 percent yield, you would not fix it by putting more raw material in the front of the pipe.”

While changes to the talent pipeline and STEM initiatives may get a lot of attention, the tech industry owes graduates better, said Dugan.

“I find the discussion about pipeline important, but inside of companies it’s essential that we fix the leaky bucket,” she said.

Dugan also said executives should insist upon diversity, citing a survey that found that 78 percent of executives believe diversity and inclusion can be a competitive advantage, but far fewer employees see obvious ways employers are moving against that goal.