Apple CEO Tim Cook addressed the graduating class of the Massachusetts Institute of Technology on Friday, where he warned students about the drawbacks of technology.

Though Cook helms one of the world's biggest technology companies, he said technology is "not always the solution," and is sometimes part of the problem. He said that shareholders have pushed Apple to focus on return on investment, but that engineers should have the courage to stand by what is right.

"Most of the time [technology] is a force for good," Cook said. "But the potential adverse consequences are spreading faster and cutting deeper than ever before. Threats to our security, threats to our privacy, fake news, and social media that sometimes becomes anti-social."

Technology must be infused with decency and kindness, Cook said.

"I'm not worried about artificial intelligence giving computers the ability to think like humans," he said. "I'm more concerned about people thinking like computers."