The U.S. spent roughly $25 billion last year on what’s loosely known as security assistance—a term that can cover everything from training Afghan security forces to sending Egypt F-16 fighter jets to equipping Mexican port police with radiation scanners.

The spending, which has soared in the past decade, can be hard to trace, funneled through dozens of sometimes overlapping programs across multiple agencies. There’s also evidence it’s not always wisely spent. In Afghanistan, for instance, the military bought $771 million worth of aircraft this year for Afghan pilots, most of whom still don’t know how to fly them.

Last year, legislators in the House drafted a bill that would require more transparency and evaluation of security and all foreign aid programs. The bill was championed by an unlikely coalition of Tea Party budget hawks and giant aid groups such as Oxfam America.

But the Obama administration successfully pushed to have security assistance exempted from the bill’s requirements, according to a letter obtained by ProPublica and interviews with Congressional staffers.

The Pentagon wrote that it “strongly” opposed last year’s bill in a statement to Congressional staff laying out its “informal view” last December. “The extensive public reporting requirements raise concerns,” the letter said. “Country A could…potentially learn what Country B has received in military assistance.” Foreign governments would also “likely be resistant” to monitoring and evaluation from the U.S. Staffers say the State Department had also resisted the bill’s increased oversight of security assistance. (The State Department declined our requests to discuss that.)

Two weeks later, the House passed a version that covered only “development assistance.” The bill never made it to a vote in the Senate.

The State and Defense Departments, which handle most security assistance, “really are scared,” said a House staffer who worked on last year’s bill. “They’re afraid of transparency about what the money is funding, where the weapons are going, who is getting training.”

As it is now, the staffer said, “some reports come two or three years after the fact, and the data is not easily manipulable.”

Increased oversight of security assistance is needed, said Walter Slocombe, former Undersecretary of Defense for Policy, who recently led a government-sponsored study on the issue. The problem is that “a lot of these programs have been developed ad hoc,” he said. “There’s not much coordination among agencies, though often they are trying to do more or less the same thing.”

New versions of the bill have been reintroduced in the House and Senate. This time, the administration’s stance isn’t clear. A spokesman for the National Security Council declined to comment, as did the Pentagon.

This year’s bill has a loophole for security spending: a waiver allowing the Secretary of State to exempt such programs if he deems it in the “national interest.”

Still, including security programs in the bill at all is “going to be a bit more difficult,” said an aide to one of the House bill’s co-sponsors, Gerry Connolly, D-Va. The exemption requires the State Department to tell Congress which programs it isn’t including, and why.

Lauren Frese, a State Department foreign assistance official said, “We support Congress’ objectives with the bill. It’s more a matter of making sure we’re not legislating something that isn’t aligned with what we’ve already got going on.” As the White House points out, it has already required agencies to be more transparent about spending on foreign aid. Agencies must upload budget data to a central public dashboard, foreignassistance.gov, though the site’s data is currently incomplete and information from the Defense Department is available only in generic categories. The bill would turn such directives into law.

The legislation also goes further. It would require the State Department to develop guidelines for monitoring and evaluating aid’s effectiveness across agencies.

In a hearing in April, the House bill’s co-sponsor, Ted Poe, R-Texas, said that “Americans want to see [whether] the money that we're sending to NGOs, the governments, et cetera is working or not working.”

Representative Connolly hopes the bill will help the public “better understand the rationale for aid, and the context: what a small, small part of the government’s budget it represents,” he told ProPublica. Indeed, foreign aid makes up only about 1 percent of the federal budget.

Supporters of the bill say excluding security assistance would leave a huge gap.

In January, an independent advisory board to the State Department recommended comprehensive reform of the whole concept of security assistance, calling for concrete objectives, better long-term monitoring, and a greater emphasis on non-military programs, such as programs to strengthen justice systems. (A few months later, the White House issued a policy directive that pledged to take on many of the same issues.)

“Nobody looks at it systematically,” said Gordon Adams, who worked on national security and international affairs for the Office of Management and Budget in the 1990s and has argued for a reduced military role in security assistance. That’s in part a reflection of how the landscape of programs has grown and fragmented in recent decades. Security assistance grew 227 percent between fiscal years 2002 and 2012, to a peak of $26.8 billion, according to data collected by the Stimson Center, where Adams is a fellow. That growth comes largely from programs in Iraq and Afghanistan, which are beginning to be scaled back. This year’s budget still allocated more than $20 billion across State and Defense.

State officially oversees all foreign aid, including many programs traditionally thought of as “military,” like weapons sales, but the Pentagon expanded its portfolio of “military operations other than war” and special operations in the 1990s. After 9/11, Congress also legislated new programs related to the “war on terror,” such as the Combating Terrorism Fellowship Program and the Coalition Support Fund. With its Afghan programs, the Pentagon accounts for more than half of all security spending – not counting covert operations.

Last year, then-Defense Secretary Leon Panetta promoted training and aid to partners as “low cost and small-footprint approaches” to military objectives.

The Pentagon’s increased role in foreign aid highlights a long-standing tension between the State Department and the military, which always has more cash on hand. “If you’ve got a $600 billion budget it’s easier to squeeze in a few million dollars here and there,” said Slocombe, who chaired the study for the State Department.

Countless examples from Afghanistan illustrate the problem of lack of both long-term planning and cooperation between agencies. In 2010, ProPublica and Newsweek documented the failures of the police training program, which had by then cost $6 billion. Responsibility shifted between agencies and contractors, and State and Defense squabbled “over whether the training should emphasize police work or counterinsurgency.” Last year, in one police facility built by the Army Corps of Engineers, the inspector general for Afghanistan reconstruction found a well building being used as a chicken coop. Another encampment, designed for 175 police, was occupied by just 12. The men didn’t even have keys for many of the buildings.

Other reports found the military paid $6 million for vehicles that were destroyed or hadn’t been seen in years, and that $12.8 million in electrical equipment was sitting unused, as Defense and USAID each expected the other to install it.

Afghanistan is an exceptional case, given the scale of the spending and wartime conditions. But it also has the scrutiny of a special inspector general and a large U.S. presence. Security assistance to other countries has far fewer eyes on it – or a clear idea of what the objectives for the aid are. Empowering local police and armies can have more severe political and human rights repercussions than digging wells. “It engages us with a bunch of countries where our interests are at best opaque,” said Adams.

Some programs are designed for political and diplomatic reasons (as was long the case with arm sales to Egypt), while others are meant to build up a country’s ability to help the U.S. in its aims, such as countering terrorism or drug-dealing. In other words, giving a country what it wants, versus what the U.S. thinks it needs. (In fact, the Government Accountability Office found that branches of the military differ on which programs are supposed to do what.)

In a February testimony, the GAO said that few of the military’s training programs had looked carefully at long-term impacts. “Reporting on progress and effectiveness,” had in some cases “been limited to anecdotal information.” For example, while Yemen has received over $360 million from two of the military’s new counterterrorism programs, due to security concerns the Pentagon has yet to evaluate whether that money’s had any effect.

The House bill’s sponsors believe it could help with these problems of planning and communication. The bill “is not designed to be hostile or adversarial for the Pentagon and State Department,” said Representative Connolly. “It’s designed to provide them with a more cogent rationale for these programs.”