(By Mark Hosenball, Reuters) – U.S. and UK spy agencies and police may soon be allowed to directly ask media companies in each others’ countries for email and online chat data for people being investigated, under a tentative bilateral deal, officials said on Friday.

As governments worldwide and online companies struggle to strike a balance between privacy rights and law enforcement imperatives, three U.S. officials confirmed a pact is in the works, although it would require congressional approval.

“The proposed agreement, which remains under discussion, would be reciprocal and would require legislation to take effect,” said a U.S. Justice Department official.

First reported by The Washington Post, the talks were focused on letting UK agencies, such as counter-intelligence unit MI5, serve “production orders” on U.S. firms demanding data for “live intercepts” in inquiries involving UK citizens.

UK agencies might also be able to ask U.S. companies to turn over stored data, such as emails.

The Post quoted a U.S. official saying that British nationals, including criminals, are using U.S. data providers such as Google, Facebook and Hotmail, making it hard for foreign agencies to get legal access to data for criminal and counter-terrorism inquiries.

The agreement’s main goal is to clear up legal conflicts faced by U.S. communications service providers when Britain issues an order seeking electronic data on users abroad, a request that may run afoul of U.S. law, the official said.

A U.S. government source, who asked for anonymity on sensitive legal issues, said U.S. law generally bars companies from complying with foreign data requests, even though criminal inquiries often hinge on cross-border communications. As a result, U.S. firms can face a tough choice: cooperate with a request and break U.S. law or ignore it and comply with the law.

A spokesperson for Britain’s Foreign Office said Britain was “not going to comment on confidential discussions.”

But the official noted big international technology companies had called for a “robust, principled and transparent framework” on data requests “across jurisdictions.”

The official said British Prime Minister David Cameron and Home Secretary (internal security minister) Theresa May were in preliminary discussions with other governments on the matter.

Representative Adam Schiff, top Democrat on the House Intelligence Committee, said Congress should monitor any privacy and civil liberties issues, “including making sure these British orders do not cover U.S. persons or individuals within the U.S., do not permit bulk collection, and have due process protections.”

(Editing by Kevin Drawbaugh and James Dalgleish)