Given the current US administration's notorious lack of respect for science, the efforts of defence secretary Robert Gates merit a mention. Gates took charge of the Pentagon in December 2006 and ever since has been trying to inform the military's thinking with researchers' insights into other cultures and societies. In October, for example, the Department of Defense launched the Human Terrain System (HTS) programme, in which teams of social scientists advise US troops operating in Iraq and Afghanistan. And on 30 June, the defence department signed a memorandum of understanding that will direct some of its money into social and behavioural science research through the National Science Foundation (NSF).

Gates's outreach may owe something to his tenure as president of Texas A&M University in College Station for the four years before his current appointment. But it certainly reflects the hard lessons of Iraq and Afghanistan — where troops with insufficient understanding of the cultural or political landscape have too often exacerbated the insurgency they were trying to control.

With an HTS team, an anthropologist, say, might be present to advise a commander on the subtleties of negotiating with village elders in rural Afghanistan. According to Gates, one commander in Afghanistan says that using an HTS team has cut the number of armed attacks he has had to make by 60%.

The recent NSF deal aims to shape the Pentagon's long-term strategic thinking by funding academic research in areas such as religious fundamentalism, terrorism and cultural change. Gates also hopes that such research could foster entirely new intellectual tools, in much the same way that work during the cold war fostered game theory. All proposals will be selected for funding through the NSF's standard peer-review process. The research will be unclassified and no restrictions will be placed on researchers' freedom to publish their results — or for that matter, to criticize the defence department.

The two initiatives have received a decidedly mixed response. Some social scientists have enthusiastically embraced the goals of the HTS programme. But the American Anthropological Association (AAA) has formally condemned it, saying that participants would find it difficult or impossible to follow the association's ethical guidelines in a combat zone, and that it could make it more difficult for anthropologists to build trust elsewhere in the world.

The NSF agreement has been widely acclaimed by university administrators, who welcome the extra research money. But it has aroused the suspicion among some researchers that it will distort social science towards military priorities. Of particular concern is the fact that the defence department will have some say in the choice of the NSF's peer reviewers.

So far, Gates and his deputies have tried to be sensitive to these concerns. But continued vigilance is paramount. War is notoriously fraught with ambiguity and moral compromise, and it may well be a temptation for commanders to use the information gathered by HTS researchers to, say, target suspect populations. Such temptations should be resisted wherever possible: in the long run, honest dealings and the do-no-harm principle required by the AAA are in the military's own best interest. So too is avoiding any temptation to load the NSF peer-review panels.

Social scientists, meanwhile, should embrace the opportunities that the AAA pointed out last November in a report on engagement with the military. These include studying military and intelligence organizations from the inside and educating the military about other cultures and societies. Outrage at the current administration should not derail efforts that have potential to be a win–win for all concerned — including, most especially, the people of Iraq, Afghanistan and regions of future conflict.