R. Michael J. Broyde on torture in halakhah (link):
However, this is very different from a serious conversation about torture in the Jewish tradition during wartime, which poses several harder and more complex questions: In what situations may torture be used in the course of war to extract vital information that cannot otherwise be obtained? Might brutality be a legitimate way to punish those who have engaged in warfare against the community, so as to persuade others to cease their actions? And most importantly, how much of Jewish law and ethics are suspended during wartime?...
In sum, according to Jewish law and ethics, torture in the context of war is no more problematic than death itself, and is permitted by the general license to wage war. There is no logical reason that halacha would categorically prohibit duly authorized wartime torture as a method for acquiring information otherwise not available, in order to save lives in the future. Of course, not all conduct permitted as a matter of Jewish law is wise or prudent; the consideration of which policies work in what settings is fundamentally not a question of Jewish law or ethics, but one for military and political leadership.
We all pray for a time when the world will be a peace — but until that time arrives, Jewish law directs the Jewish state and the American nation to do what it takes (no more, but no less, either) to survive and prosper ethically in the crazy world in which we live.