Republican presidential candidate Donald Trump speaks at a campaign stop, Wednesday, March 30, 2016, in Appleton, Wis. (AP Photo/Nam Y. Huh)

In the middle of a Pentagon press briefing Thursday about the U.S. military campaign against the Islamic State, a two-star general was asked a question: Does he ever hear anyone in the coalition talk about keeping nuclear weapons on the table as an option against militants?

The question came after Republican presidential candidate Donald Trump said earlier this month that he would not rule out using tactical nuclear weapons against the Islamic State. But the premise still seemed to catch the officer, British Maj. Gen. Doug Chalmers, off-guard.

“That’s a conversation, frankly, I’ve never heard discussed amongst any of our coalition members at any stage,” said Chalmers, who is currently on exchange with the U.S. Army and a deputy commander in the military campaign in Iraq and Syria. “I have to admit, that one has taken me completely by surprise.”

Chalmers is hardly the first officer to be asked about views expressed in the U.S. presidential election. It’s happened repeatedly in recent months, putting senior military leaders in the uncomfortable position of weighing in on political rhetoric even though a Defense Department directive prohibits them from engaging in “partisan political activity.” That directive does not forbid active-duty members of the military from speaking their mind as individuals on political issues, but senior military officers still usually steer clear of making statements that could be construed as political.

As the presidential election season has continued, however, senior defense officials have been asked repeatedly to weigh in and provide a reality check. Most commonly, that has been in response to statements made by Trump, although after Ted Cruz claimed that he would “carpet-bomb” the Islamic State the senior U.S. commander in Iraq, Army Lt. Gen. Sean MacFarland, said in February “indiscriminate bombing” is “inconsistent with our values.”

The unofficial ground rules appear to be that military officials will discuss issues raised by Trump and other candidates, but most commonly they, lawmakers and journalists all avoid naming the candidates when doing so.

That has especially occurred since February, when Defense Secretary Ashton B. Carter said during a House Appropriations Committee hearing that he did not want his department involved in political debates. He did so after Rep. Betty McCollum (D.-Minn) asked him and Marine Gen. Joseph F. Dunford, chairman of the Joint Chiefs of Staff, to comment on Trump’s claims that he would order service members to torture Islamic State militants and target their families.

“I feel very strongly that our department needs to stand apart from the electoral season so I respectfully decline to answer any questions that arise from the political debate going on,” Carter said. “I want General Dunford, especially even more so than me, to not get involved in political debates.”

Dunford eventually responded to McCollum’s question, saying he “would not get into what Secretary Carter highlighted,” but the U.S. military would continue to uphold with American values.

On Thursday, Chalmers was asked by CNN’s Barbara Starr to comment both on the potential use of nuclear weapons against the Islamic State and whether he had ever heard troops complain that they were afraid to fight because of the Geneva Conventions. Starr did not use Trump’s name, but the questions came after Trump told a crowd in Wisconsin on Wednesday that the rules, adopted by the United States and many other nations after World War II, made troops hesitant.

“The problem is we have the Geneva Conventions, all sorts of rules and regulations, so the soldiers are afraid to fight,” Trump said.

Chalmers said that he had seen “over the last couple of years similar sorts of articles” raising that question, but that his troops have always understood “the underpinning context” of the conventions, which calls for humane treatment for prisoners of war, civilians and wounded troops.

“We regard it very much as a sense of basic principles which guide our behavior in battle and very much enable us to deal with which is a very unusual human experience,” Chalmers said. “And to live within those rules, I think is good for both our soldiers and indeed, the very population that we fight on behalf of.”

In another example Wednesday, Carter and Dunford answered a question about whether the North Atlantic Treaty Organization (NATO) was obsolete, after Defense One editor Kevin Baron noted in a news conference in Tampa that the issue had come up on “the campaign trail recently.”

Like Starr, Baron didn’t mention Trump’s name specifically. But Trump made headlines after questioning whether NATO was obsolete in a March 21 editorial board meeting with The Washington Post.

“I had the privilege of commanding NATO forces in Afghanistan,” Dunford said. “And when you think about it, it’s pretty extraordinary that for 10 years, NATO has formed the core of a coalition in Afghanistan that has stayed together and is still is together today with the Resolute Support mission, to move Afghanistan in the future… In my mind, the relevance of NATO is not at all in question. In fact, I think it’s a question of making sure we have the right focus because there’s a lot of work to be done.”

This story was corrected to reflect that Gen Joseph Dunford commented about NATO at a Tampa news conference, rather than Gen. Joseph Votel.