PALO ALTO — Silicon Valley, known for its cultivation of big tech companies and business leaders, in many ways has roots intertwined with schools like Stanford University.

As the keynote speaker for the school’s 128th commencement ceremony Sunday, Apple CEO Tim Cook warned its graduates not to succumb to one of Silicon Valley’s latest inventions.

“Fueled by caffeine and code, optimism and idealism, conviction and creativity, generations of Stanford graduates (and dropouts) have used technology to remake our society,” Cook said.

“But lately, it seems, this industry is becoming better known for a less noble innovation: the belief that you can claim credit without accepting responsibility. … “We see it every day now, with every data breach, every privacy violation, every blind eye turned to hate speech. Fake news poisoning our national conversation.”

He referenced Theranos, the company founded by Stanford dropout Elizabeth Holmes, who faces fraud charges over her blood-testing company.

“The false promise of miracles in exchange for a single drop of your blood. Too many seem to think that good intentions excuse away harmful outcomes,” Cook said, eliciting some gasps in the crowd.

Cook addressed some of the more than 5,200 graduates who received bachelor, masters and doctoral degrees from Stanford University this weekend.

Students entered the stadium with a Stanford tradition — a light-hearted procession called the “Wacky Walk.” Rather than the traditional cap and gown, many students wore animal costumes, themed group outfits and two men wore shaving cream on their faces with bath towels wrapped around their waists. Some held signs that were political; a student held one that read “Stanford still protects rapists.”

Stanford President Marc Tessier-Lavigne urged graduates to use Cook as an example of self-examination and using influence for the greater good.

“You have the opportunity to use your gifts to make a difference in the world,” said Tessier-Lavigne, who began the ceremony with a moment of silence for an undergraduate who was found dead in a campus dorm over the weekend.

“Tim is a brilliant example of someone who has used his platform to achieve greater impact beyond his company.”

Cook, who has been critical of companies like Facebook and Google for their approach to consumer digital privacy, didn’t name any other companies in his speech but said the ramifications of data breaches have a greater societal impact.

“In a world without digital privacy, even if you have done nothing wrong other than think differently, you begin to censor yourself,” Cook said. “To risk less, to hope less, to imagine less, to dare less, to create less, to try less, to talk less, to think less.”

“Your generation ought to have the same freedom to shape the future as the generation that came before,” he said. “If you want to take credit, first learn to take responsibility.”

Cook also addressed his own challenges in filling the shoes of his predecessor, former Apple CEO Steve Jobs, who died of cancer in 2011.

The Apple executive said he was in denial that Jobs’ illness would kill him, and had harbored the belief that Jobs would step back but continue to lead the company behind the scenes.

“I was convinced he would stay on as chairman. That he’d step back from the day to day but always be there as a sounding board,” Cook said. “And when he was gone, truly gone, I learned the real, visceral difference between preparation and readiness.”

He hearkened back to the advice Jobs had given Stanford graduates at a commencement speech on the same stage 14 years ago.

“Don’t waste your time living someone else’s life. Don’t try to emulate the people who came before you to the exclusion of everything else, contorting into a shape that doesn’t fit,” Cook said.

“It takes too much mental effort,” he said, “effort that should be dedicated to creating and building.”

Contact Thy Vo at 408-200-1055 or tvo@bayareanewsgroup.com.