Eric Schmidt on Wednesday shared some of his top concerns regarding the future of the internet -- namely, preserving its interconnectedness and ensuring that artificial intelligence isn't used to militarize it.

"Machine learning capabilities... need to be done in the open and not in military research labs," the Alphabet executive chairman said on stage at the RSA cybersecurity conference in San Francisco.

Had the internet developed within the confines of military research labs, "We'd spend all day worrying if they were in our networks, the internet would begin being shut down," he said. "One of the questions the industry should be asking is can we come up with a way where countries can agree not to use machine learning technologies in a way that militarizes the internet."

He noted that at the end of the Obama administration, President Obama and President Xi of China inked a deal to bring down the number of cyberattacks against each other. There's "some evidence that worked," Schmidt said.

He stressed the importance of "getting the governments to agree we are better off collectively with a more open internet."

"I'm extremely worried about the likelihood that countries will begin to block the openness and interconnectedness of the internet," Schmidt said, adding that the threat of cyberattacks could be used as a pretext to shut off some access.

The executive stressed that real security doesn't amount to building walls.

"Security is a series of layers of protection, it's not one incredibly strong firewall...Security is a lifestyle," he said. "If you build a system that is perfect and closed, you will find out it is neither perfect nor closed."

Conducting research transparently should also help close the gap between the way the public perceives AI -- which can often be apocalyptic -- and the way engineers view it, Schmidt said. That will create greater public awareness, he said, of the benefits that will come from advances in areas like computer vision.

"Things that bedevil us -- traffic accidents, bad diagnoses in the medical system -- are going to be much better," he said. "That's going to be the real narrative over the next five years. It's hard to know what happens after that."

Schmidt said Google is "trying to stimulate the industry" with with products like Tensorflow, its open source framework for machine learning. The company earlier Wednesday announced the availability of the updated version, TensorFlow 1.0. Still, he acknowledged that Google has a huge competitive advantage when it comes to AI, given its vast data sets.