JOSE WALL was distressed. A senior special agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF), Mr. Wall testified on Capitol Hill last week about Operation Fast and Furious, the discredited ATF program that resulted in some 2,000 illegal guns making their way into Mexico.

“I am especially concerned for the brave law enforcement officers and military in Mexico and here in the United States,” Mr. Wall said. “I fear these firearms will continue to exact a terrible toll long after these hearings are over.” Two such weapons were found in December at the scene of the murder of a U.S. Border Patrol agent. Mr. Wall was one of six current or former ATF agents who testified — often in damning and emotional terms — about other mistakes connected to the operation, including the decision by ATF officials in the know to keep the existence of Fast and Furious from their ATF colleagues in Mexico.

Yet lost amid the understandable furor over the mistakes was the fact that Operation Fast and Furious was a response to — and not the cause of — the flow of illegal guns from the United States into Mexico, which has contributed to the drug-cartel-related deaths of some 40,000 people over the past five years.

ATF had been criticized in the past for not being more ambitious in its efforts to crack down on gun smuggling along the border. Critics charged, for example, that targeting individual straw buyers would do little to staunch the flow of guns. Launched in 2009, Operation Fast and Furious was headquartered in ATF’s Phoenix office and meant to address these perceived weaknesses. In hopes of moving against higher-ups and disrupting the supply chain, ATF did not immediately pounce on suspected straw buyers and instead watched as they made repeated visits and passed firearms to third parties.

But the agency, whose budget has been repeatedly targeted by Congress, often did not have the means to follow through. During the July 26 hearing before the House Committee on Oversight and Government Reform, former ATF officials involved in the program testified that the lack of resources and personnel meant they sometimes had to drop their surveillance. As a result, they lost track of some 2,000 guns, many of which have now been traced to criminal activity south of the border.

Congress is right to investigate the failings of Operation Fast and Furious, as is the Justice Department’s Office of the Inspector General. But rather than merely clubbing the agency, lawmakers should also be exploring ways to strengthen its ranks and reinforce its mission to get illegal guns off the streets. For starters, lawmakers should be working with the administration to fill the agency’s top slot, which has been vacant for years because of congressional obstructionism. They should heed the words of five of the six agents who testified last week and pass stronger laws against straw purchases; they should also take up provisions to ban the sale of assault weapons and to close the gun show loophole that allows some individuals to buy weapons without undergoing background checks.

ATF’s primary mission is to keep guns out of the hands of criminals, including those who ply their trade south of the border. Congress should act swiftly to enable the agency to operate effectively.