Although I grant requests from prosecutors far more often than I deny them, I’ve written several opinions disagreeing with them on the use of investigative technology. As a former prosecutor, I understand their preference that other judges consider requests on surveillance technologies. My goal in deciding these issues (and the goal of some like-minded colleagues) is not to say no to the government but to ask the right question. It’s not enough to search laws written before modern technology and find one that comes closest to fitting today’s facts. The question is whether any law allows a judge to issue the order the government wants. If no such law exists, society needs to make deliberate choices about how best to balance the promise of more efficient investigative technologies against the risks to personal liberty.

Those decisions are best made in Congress, but if Congress fails to do so, judges should at least hear opposing views and give a public account of the reasoning behind their decision. These choices should not be left to the secret deliberation of a judge, handpicked by prosecutors, who sits on the lowest tier of the judiciary.

And ultimately, that’s the problem: A Congress that has failed to keep pace with the times, not prosecutors aggressively using new technological tools. Congress has not enacted any thorough updates of the digital privacy laws that govern law enforcement investigations since the early days of the internet — long before we entrusted virtually every bit of information about our lives to our electronic devices and to the cloud. (That’s why the Justice Department relied on a law written in 1789 when it tried to force Apple to help search an iPhone by disabling the device’s password protection. I ruled against the government in that case.)

It is impossible to measure the cost in privacy losses and years spent behind bars suffered by people who could have successfully raised the issue decided in the Carpenter case if it hadn’t taken so many years to reach the Supreme Court. It is likewise impossible to know how many investigations and prosecutions have been stymied because prosecutors lacked clear rules and could not take the risk that a particular investigative technology could undermine an important case.

If Congress won’t write laws for this century’s technology, courts must craft rules that ensure a fair and orderly review of new investigative methods. For example, the Foreign Intelligence Surveillance Court (which also confronts the tension between effective investigations and privacy) has a system for bringing in independent lawyers called “amici curiae” to argue novel or significant legal issues that occasionally arise when the government asks for technology-based surveillance orders. Those amici can argue in favor of the target’s presumed privacy interests but don’t represent him and can’t give him information about the investigation.

Magistrate judges occasionally do the same on an ad hoc basis, but in those cases the amici don’t have the same access to information as is allowed in the surveillance court, and, like the amici there, they can’t appeal a lower-court ruling. Giving these independent lawyers the information they need to argue about the legality of novel law enforcement requests, as well as the right to appeal, would at least provide for a more balanced assessment of new surveillance technologies and a quicker way for questions about them to be decided on a national basis.

I don’t presume that any of my rulings have struck the right policy balance between law enforcement and personal privacy. That’s not even a question a judge like me should try to answer. But as the pace of technological advancement increases, the need becomes more urgent for society to balance those interests in a coherent, fair and democratic way.

James Orenstein is a United States magistrate judge in the Eastern District of New York.

Like other media companies, The Times collects data on its visitors when they read stories like this one. For more detail please see our privacy policy and our publisher's description of The Times's practices and continued steps to increase transparency and protections.

Follow @privacyproject on Twitter and The New York Times Opinion Section on Facebook and Instagram.