As reported by AFP, Mayer was asked what she is doing to protect Yahoo users from "tyrannical government" at the TechCrunch Disrupt conference in San Francisco, and she said while her company "scrutinises and fights" US government data requests which have been authorised by the Foreign Intelligence Surveillance Court, it was in a tough position.
She said Yahoo, once it lost any court argument, had no choice but to grant the requests.
"If you don't comply, it is treason," Mayer said.
"We can't talk about it because it is classified, Releasing classified information is treason, and you are incarcerated. In terms of protecting our users, it makes more sense to work within the system."
The National Security Agency (NSA) is the central producer and manager of signals intelligence for the United States.
Meanwhile Facebook CEO Mark Zuckerberg said the U.S. government “blew it” in communicating what was happening with the NSA leaks.
“I think they did a bad job balancing those things here,” Zuckerberg said at the TechCrunch conference. "Frankly I think the government blew it–communicating the balance of what they were going for here with this.”
“The morning after this started breaking, a bunch of people were asking them what they thought,” Zuckerberg said.
“(They said) don’t worry, we’re not spying on any Americans. Wonderful, that’s really helpful for companies trying to work with people around the world. Thanks for going out there and being clear. I think that was really bad.”
Controversy over the NSA's security program has raged for months, with iTWire's senior associate editor Graeme Philipson saying he was "disgusted" in an opinion piece earlier this week. The extent of NSA's activity first came to light earlier this year when whistleblower Edward Snowden revealed a massive program of spying and surveillance to journalists.