BOSTON (AP) — Facebook executive Sheryl Sandberg didn’t shy away from her company’s ongoing privacy scandal in a Friday commencement speech at the Massachusetts Institute of Technology. Instead, she turned it into a lesson about accountability.

Sandberg, the company’s chief operating officer, repeatedly warned graduates that even technology created with the best intentions can be twisted to do harm, a lesson that she said hits close to home, “given some of the issues Facebook has had.”

“At Facebook, we didn’t see all the risks coming, and we didn’t do enough to stop them,” Sandberg said. “It’s hard when you know you let people down.”

Echoing previous comments from Facebook CEO Mark Zuckerberg, Sandberg went on to emphasize the importance of taking full responsibility for mistakes.

“When you own your mistakes, you can work hard to correct them, and even harder to prevent the next ones,” she said at the campus in Cambridge, Massachusetts. “That’s my job now. It won’t be easy, and it’s not going to be fast, but we will see it through.”

Hours after her address, the company was confronted with the latest in a series of privacy scandals that have rocked the social-media giant. This time, The Wall Street Journal reported that Facebook had made deals to share user information with select companies, even after the 2015 date when executives have said the network prevented outside developers from accessing that data.

Only days earlier, the company faced backlash over revelations that it shared user data with certain device makers, and that an unrelated software bug made some private posts public for up to 14 million users in May. All that followed Zuckerberg’s appearance before Congress in April, when he apologized for Facebook’s role in a privacy scandal involving British data mining company Cambridge Analytica.

But during her speech, Sandberg said she’s still proud of the company, noting its power to help organize movements like the Women’s March and Black Lives Matter. Still, she warned graduates that technology has a flipside, and isn’t always used for the sake of good.

“It also empowers those who would seek to do harm,” she said. “When everyone has a voice, some raise their voices in hatred. When everyone can share, some share lies. And when everyone can organize, some organize against the things we value the most.”

Sandberg, an alumna of Harvard University, is a former vice president at Google and was chief of staff for the U.S. Treasury Department under President Bill Clinton. She has written three bestselling books on leadership and resilience.

Much of her speech was about the role of technology in society, a common topic at MIT, a school known for its tech prowess. But her advice also drew on broader topics that have captured the nation’s attention, including tensions tied to race and gender.

“Build workplaces where everyone — everyone — is treated with respect,” she said. “We need to stop harassment and hold both perpetrators and enablers accountable. And we need to make a personal commitment to stop racism and sexism.”