Twitter has asked a New York state judge to throw out a court order requiring it to turn over three months worth of messages posted by an Occupy Wall Street protester being prosecuted for disorderly conduct.

In a motion (PDF) filed on Monday in New York City Criminal Court, Twitter lawyers argued the city's district attorney's office is overstepping its authority in ordering the tweets and other subscriber info of Malcolm Harris, whose handle on the microblogging site is @destructuremal. Prosecutors seeking the data failed to get a court warrant based on probable cause, making an order they obtained earlier a violation of federal law and the Constitution's prohibition against unreasonable searches and seizures, the Twitter brief argued.

"If the order stands, Twitter will be put in the untenable position of either providing user communications and account information in response to all subpoenas or attempting to vindicate its users' rights by moving to quash these subpoenas itself—even though Twitter will often know little or nothing about the underlying facts necessary to support their users' argument that the subpoenas may be improper," Twitter's attorneys argued.

Rather than get a warrant based on probable cause, the New York City prosecutors cited the Stored Communications Act, which requires only that investigators show the requested information is relevant to an ongoing criminal investigation. After receiving the demand, Twitter provided notification to Harris, who challenged the demand on the grounds the information prosecutors were seeking fell outside the limitations of the statute. Last month, New York Criminal Court Judge Matthew A. Sciarrino, Jr. denied Harris's motion (PDF), arguing he had no legal standing to challenge the subpoena because he had no proprietary interest in the data investigators sought.

Twitter's brief argued that Sciarrino's order contradicts the terms of service provisions guaranteeing users "retain rights to any content [they] submit, post or display" on the site.

"To hold otherwise imposes a new and overwhelming burden on Twitter to fight for its users' rights, since the order deprives its users of the ability to fight for their own rights when faced with a subpoena from New York State."

Monday's brief also argued that Sciarrino's order would force Twitter to violate federal law because the Constitution's Fourth Amendment requires service providers to disclose user communications only when presented with a valid search warrant. As support, the attorneys cited a 2010 ruling from the Sixth Circuit Court of Appeals that said government prosecutors couldn't rely on the Stored Communications Act to the e-mail of a man they were investigating for fraud. They also said the statute doesn't cover communications that are less than 180 days old. Prosecutors investigating Harris are seeking tweets sent from September 15 to December 31 of last year, meaning some of the requested information won't be 180 days old until the end of June.

The Twitter attorneys also cited a unanimous US Supreme Court ruling from last year holding that FBI investigators had to obtain a search warrant before using a GPS device attached to a suspect's vehicle to track his whereabouts for four weeks.

"If the Fourth Amendment's warrant requirement applies merely to surveillance of one's location in public areas for 28 days, it also applies to the District Attorney’s effort to force Twitter to produce over three months worth of a citizen’s substantive communications, regardless of whether the government alleges those communications are public or private," the brief argued.

Twitter has frequently gone beyond the call of duty in notifying users of government demands to turn over their information. In late 2010 or early 2011, site representatives informed users who were named in a previously sealed court order that sought IP addresses associated with WikiLeaks and several of its supporters. Both Google and California-based ISP Sonic.net, according to The Wall Street Journal, fought for the right to inform at least one of the users of secret orders seeking the data. According to an attorney representing WikiLeaks founder Julian Assange, Facebook, and Skype (which was then owned by eBay) received demands for similar information and never disclosed how they responded.

"There's this issue of confidence in third-party service providers and how much they're going to make the government fight for user information," Venkat Balasubramani, a legal blogger and technology lawyer in Seattle, told Ars. "Twitter is one of the companies that's building a reputation of a company that will fight the battle. From that standpoint twitter is notable."

Indeed, the Electronic Frontier Foundation, in a in a side-by-side comparison dubbed Who Has Your Back, last year gave Twitter props for regularly warning users of data demands and fighting for user privacy. Other companies, including Comcast, MySpace, and Skype, didn't fare as well in the analysis.

Article updated to correct details about document demand received by Twitter from prosecutors investigating WikiLeaks and to provide additional details about secret orders sent to Google and Sonic.net.