One of the most critical matters facing Congress is the need to enact long-term legislation updating our nation’s foreign intelligence surveillance laws. Intercepting the communications of terrorists and other intelligence targets has given us crucial insights into the intentions of our adversaries and has helped us to detect and prevent terrorist attacks.

Until recently, our surveillance efforts were hampered by the unintended consequences of an outdated law, the Foreign Intelligence Surveillance Act, which was enacted in 1978 to establish a system of judicial approval for certain intelligence surveillance activities in the United States.

The requirement that a judge issue an order before communications can be intercepted serves important purposes when the target of the surveillance is a person in our country, where constitutional privacy interests are most significant. The problem, however, was that FISA increasingly had come to apply to the interception of communications of terrorists and other intelligence targets located overseas. In FISA, Congress had embedded the crucial distinction between whether targets are inside or outside our country, but did so using terms based on the technology as it existed then. However, revolutionary changes in communications technology in the intervening years have resulted in FISA applying more frequently to surveillance directed at targets overseas. The increased volume of applications for judicial orders under FISA impaired our ability to collect critical intelligence, with little if any corresponding benefit to the privacy of people in the U.S.

This summer, Congress responded by passing the Protect America Act. That law, passed with significant bipartisan support, authorized intelligence agencies to conduct surveillance targeting people overseas without court approval, but it retained FISA’s requirement that a court order be obtained to conduct electronic surveillance directed at people in the United States. As J. Michael McConnell, the director of national intelligence, stated, the new law closed dangerous gaps that had developed in our intelligence collection. Congress, however, set the act to expire on Feb. 1, 2008.

It therefore is vital that Congress put surveillance of terrorists and other intelligence targets located overseas on surer institutional footing. The Senate Intelligence Committee has crafted a bill that would largely accomplish that objective. Recognizing the uncommon complexity of this area of the law, the committee held numerous hearings on the need to modernize FISA, received classified briefings on how various options would affect intelligence operations and discussed key provisions with intelligence professionals and with national security lawyers inside and outside government. This thorough process produced a balanced bill approved by an overwhelming, and bipartisan, 13-2 vote.

The Senate Intelligence Committee’s bill is not perfect, and it contains provisions that I hope will be improved. However, it would achieve two important objectives. First, it would keep the intelligence gaps closed by ensuring that individual court orders are not required to direct surveillance at foreign targets overseas.

Second, it would provide protections from lawsuits for telecommunications companies that have been sued simply because they are believed to have assisted our intelligence agencies after the 9/11 attacks. The bill does not, as some have suggested, provide blanket immunity for those companies. Instead, a lawsuit would be dismissed only in cases in which the attorney general certified to the court either that a company did not provide assistance to the government or that a company had received a written request indicating that the activity was authorized by the president and determined to be lawful.

It is unfair to force such companies to face the possibility of massive judgments and litigation costs, and allowing these lawsuits to proceed also risks disclosure of our country’s intelligence capabilities to our enemies. Moreover, in the future we will need the full-hearted help of private companies in our intelligence activities; we cannot expect such cooperation to be forthcoming if we do not support companies that have helped us in the past.

The bill that came out of the Senate Intelligence Committee was carefully crafted and is a good starting point for legislation. Unfortunately, there are two other versions of the bill being considered that do not accomplish the two key objectives. The House of Representatives recently passed a version that would significantly weaken the Protect America Act by, among other things, requiring individual court orders to target people overseas in order to acquire certain types of foreign intelligence information. Similarly, the Senate Judiciary Committee made significant amendments to the Senate Intelligence Committee’s bill that would have the collective effect of weakening the government’s ability to effectively surveil intelligence targets abroad.

Moreover, neither the House bill nor the Senate Judiciary Committee’s version addresses protection for companies that face massive liability. Both the Senate Judiciary Committee amendments and the House bill passed largely on party lines, and the full Senate will be debating this issue shortly.

Congress must choose how to correct critical shortcomings in our foreign intelligence surveillance laws. It is a time for urgency: The Protect America Act expires in just two months, and we cannot afford to allow dangerous gaps in our intelligence capabilities to reopen. But this is also a time of opportunity, when we can set aside political differences to develop a long-term, bipartisan solution to widely recognized deficiencies in our national security laws. When Congress returns to this challenge, it should continue on the course charted by the Senate Intelligence Committee.

Michael B. Mukasey is the attorney general of the United States.