Yahoo reportedly gave US government access to all users' emails (updated)

The company built custom software to let officials search incoming messages.

According to Reuters, Yahoo provided US intelligence officials access to all of its customers incoming emails last year. The publication's sources claim that the company had to comply with a classified request from the government, which allowed the National Security Agency and FBI to scan "hundreds of millions" of Yahoo Mail accounts.

To do so, Yahoo secretly built a custom software that officials could use to search emails for specific information, although it's not known what exactly they were looking for. As Reuters notes, based on comments from surveillance experts, this marks the first time that an American internet firm has agreed to meet the demands from a US spy agency en mass.

Even if it was handed a classified directive, Yahoo seems to have opened the floodgates to the NSA and FBI, rather than offer access to clear-cut materials -- like stored messages or specific accounts. And that could set a bad precedent. Since the Edward Snowden leaks, the relationship between tech companies and the US government has been rocky, with the likes of Apple, Google and Microsoft fighting hard to keep people's private information secure.

Per today's report, the decision to adhere to this request falls on CEO Marissa Mayer, and was apparently the reason Chief Security Officer Alex Stamos left Yahoo in 2015. The news comes only days after The New York Times published a story claiming that Yahoo downplayed security for years, hot on the heels of that massive 2014 breach the company took two years to make public.

We've reached out to Yahoo for comment and will update our story as soon as we hear back.

Update: In a statement sent to Engadget, a Yahoo spokesperson said, "Yahoo is a law abiding company, and complies with the laws of the United States." Nothing else beyond that. Meanwhile, Snowden's taken to Twitter to share his thoughts about the situation.