Legislation introduced in the U.S. Senate on Thursday aims to place limits on access by U.S. law enforcement agencies to emails and other communications stored abroad.

The proposed legislation comes against the backdrop of a dispute between Microsoft and the government, in which the tech company has refused to hand over emails held by it at a facility in Dublin, Ireland.

The new bill, called the Law Enforcement Access to Data Stored Abroad (LEADS) Act, aims to amend the Electronic Communications Privacy Act to authorize the use of search warrants extraterritorially, only where the government wants to obtain the contents of electronic communications belonging to a U.S citizen or permanent resident alien or a company incorporated in the U.S.

It also provides that the court issuing the warrant shall modify or vacate the warrant, if it finds that it would require the communications provider or remote computing service to violate the laws of a foreign country.

The bill introduced by U.S. Senators Orrin Hatch, a Republican from Utah and current member and former chairman of the Senate Judiciary Committee, Chris Coons, a Democrat from Delaware and member of the Judiciary Committee, and Dean Heller, a Republican from Nevada.

“The government’s position that ECPA warrants do apply abroad puts U.S. cloud providers in the position of having to break the privacy laws of foreign countries in which they do business in order to comply with U.S. law,” Coons said in a statement.

“This bill proposes a more principled legal blueprint for balancing law enforcement needs with consumer privacy rights,” said Microsoft general counsel Brad Smith in a blog post. “It also creates an important model that will help advance the international conversation that is so critically needed.”

U.S. Magistrate Judge James C. Francis IV of the U.S. District Court for the Southern District of New York in April declined to quash a December warrant that authorized the search and seizure of information, including content and identifiers such as name and physical address, of a Web-based email account stored at Microsoft’s premises.

The company held that courts in the U.S. are not authorized to issue warrants for extraterritorial search and seizure, but Judge Francis held that a warrant under the Stored Communications Act, a part of the ECPA, was “a hybrid: part search warrant and part subpoena.” It is executed like a subpoena in that it is served on the Internet service provider who is required to provide the information from its servers wherever located, and does not involve government officials entering the premises, he noted.

Microsoft is appealing the order after some procedures are met.

There are some specific concerns with the bill, wrote Greg Nojeim, senior counsel at online civil liberties organization Center for Democracy & Technology in a blog post, while applauding the bill’s overall thrust.

One odd result will be that the LEADS Act would establish one rule - the extraterritorial warrant - for U.S. law enforcement to access content that a U.S. provider stores abroad on behalf of an American, and the multinational Mutual Legal Assistance Treaty, or MLAT process, for a person who sits in the cubical next door, but who may be a non-citizen working in the U.S. on a temporary visa, Nojeim wrote. MLAT governs exchange of information between countries for law enforcement purposes.