Microsoft has sued the US Department of Justice (DoJ) over the software giant's right to alert users when their personal data has been accessed by cops and Feds.

Redmond chief legal counsel Brad Smith announced on Tuesday that Microsoft will seek [PDF] a legal declaration confirming that it should not be silenced by investigators. Microsoft wants to warn people when their cloud-hosted files and messages have been requested by law enforcement, but the biz is often hit by gag orders.

"We believe that with rare exceptions, consumers and businesses have a right to know when the government accesses their emails or records. Yet it's becoming routine for the US government to issue orders that require email providers to keep these types of legal demands secret," Smith said in announcing the move.

"We believe that this goes too far and we are asking the courts to address the situation."

Microsoft alleges that the DoJ is infringing on its First and Fourth Amendment rights by not allowing the company to post notifications to customers when a government agency has asked to view data hosted on Microsoft's web services or cloud platforms.

Microsoft is seeking a court declaration that would allow it to provide notification to its customers by invalidating section 2703(b) of the US Code as unconstitutional.

"Even when circumstances initially justify a secrecy order as the narrowest means available to satisfy a compelling government interest, the First Amendment demands that the provider be free to engage in truthful speech about the government's activities as soon as secrecy is no longer required to satisfy that interest," Microsoft argues in its filing.

Redmond has clashed with the DoJ recently over search warrants when the feds argued that they had the right to enter a Microsoft data center in Ireland in order to execute a search warrant. ®