Gay soldiers soldiers have been warned by one legal group not to answer a Pentagon survey on lifting the military’s ban on out troops.

The Servicemembers’ Legal Defence Network (SLDN) said some soldiers could accidentally expose their sexual orientations by answering questions because the Defence Department has not granted them immunity.

The law in question allows gay men and lesbians to serve in the military as long as they keep their sexuality secret. Those who come out, or are outed, face dismissal. It is currently subject to a year-long review after President Barack Obama pledged to repeal it.

Around 400,000 soldiers have been emailed the survey, which asks for opinions on repealing the law and what impact troops think it will have.

The Pentagon says all data is confidential and the survey is being carried out by a third-party contractor who will strip all identifying details from responses.

A Pentagon spokeswoman pointed out what the survey does not actually ask whether respondents are gay, although it will ask about their experiences serving alongside gay troops.

An SDLN statement said: “At this time SLDN cannot recommend that lesbian, gay, or bisexual service members participate in any survey being administered by the Department of Defence, the Pentagon Working Group, or any third-party contractors.”

However, the Palm Centre, a research unit which has studied the ban, welcomed the research, although it said support for ending the ban was unlikely.

Director Aaron Belkin said: “This survey is part of the agreed-to process of dismantling ‘don’t ask, don’t tell.’ Because servicemembers are just now being educated about the ramifications of ending the policy, we anticipate that the survey results will not be supportive of repeal.

“That said, we welcome the results and value the feedback of all the troops. We will pay close attention to this process.”