Microsoft has filed a lawsuit against the US government over the number of secrecy orders it has received that allow g-men and cops access to customers' e-mails and other records.

The software giant's chief legal officer Brad Smith said that gag orders had been applied to 2,576 such demands over the course of an 18-month period. Microsoft's top counsel added that 1,752 (68 percent) of those secrecy orders had no end date—"This means we effectively are prohibited forever from telling our customers that the government has obtained their data," he said.

Smith added in a blog post:

To be clear, we appreciate that there are times when secrecy around a government warrant is needed. This is the case, for example, when disclosure of the government’s warrant would create a real risk of harm to another individual or when disclosure would allow people to destroy evidence and thwart an investigation. But based on the many secrecy orders we have received, we question whether these orders are grounded in specific facts that truly demand secrecy. To the contrary, it appears that the issuance of secrecy orders has become too routine.

Microsoft alleged in its lawsuit against the US government that two fundamental rights had been violated.

It cited the Constitution's Fourth Amendment, which gives US citizens the right to know if the government has searched or seized their property; and the First Amendment, which Microsoft said gives it the right to talk to its customers about any government action involving their data.

Smith added in his post that cloud computing should not be used as a shortcut by police and spooks to gain access to information belonging to Microsoft's customers: "Customers generally shouldn’t be entitled to less notice just because they have moved their e-mails to the cloud."

The US government uses the Electronic Communications Privacy Act (ECPA) more and more, Microsoft complained. "In fact, secrecy provisions in ECPA today are out of step with other US laws that contain clearer limitations on secrecy provisions and allow law enforcement flexibility for extensions," argued Smith.

Microsoft has recently mounted a number of other legal challenges against the US government's attempts to access customers' data. One such case relates to a US search warrant to access the customer e-mails of a foreign individual in Ireland. That particular lawsuit is pending in the US Court of Appeals for the Second Circuit, said Smith.