Documentary film-makers operating in some of the most dangerous countries in the world are having their work disrupted and security compromised by a Trump administration edict that forces them to disclose their social media activities when applying to enter the US, a new lawsuit claims.

The US homeland security and state departments were sued in a federal court in Washington on Thursday over a rule change that the plaintiffs argue could put film-makers in personal peril. The suit concerns a registration requirement introduced in May that affects more than 14 million visa applicants each year, obliging them to disclose all social media behavior including the pseudonymous handles they use to protect their identity.

The legal action has been brought by two US-based documentary film organizations that collaborate with international directors and producers. The films created through these networks often deal with highly sensitive subjects such as political dissent and corruption.

“In many cases, our partners can be thought of as activists with cameras. Many work with various kinds of risk – physical, political or other forms of persecution,” said Oliver Rivers, a director of one of the plaintiff groups, Doc Society which is headquartered in New York and London.

Under the rule change, film-makers wanting to come to the US to work with Doc Society or its fellow plaintiff, the Los Angeles-based International Documentary Association (IDA), must fill out electronic visa application forms in which they are required to state which of 20 social media platforms they have used in the past five years. The platforms include Facebook, Flickr, Google+, Instagram, LinkedIn, Twitter and YouTube as well as several sites in China and other countries.

In each case, the applicant must divulge the social handle they post under, effectively forcing them to break their anonymity and hand the information over to the US government. The DHS and state department are known to store the data for up to 100 years after an applicant’s date of birth and are allowed to share the intelligence with other federal and state agencies as well as “international government agencies”.

In effect, the rule change permits the US government to hand over personal information on foreign film-makers to the very government bodies who they might be investigating in their documentary work. It also amounts to a massive new form of surveillance.

“The registration requirement is the linchpin of a far-reaching and unconstitutional surveillance regime that permits the government to monitor the online activities of millions of visa applicants, and to continue monitoring them even after they’ve entered the United States,” said Jameel Jaffer, executive director of the Knight Institute which along with the Brennan Center is legally representing the film groups.

The plaintiffs are petitioning the federal court to block the social media disclosure provision on grounds that it unlawfully infringes the free speech rights of the film-makers and subjects them to arbitrary and capricious government action. They argue that if the requirement is allowed to stand it will place a chill on the political activities and creativity of the artists.

“Our partners are telling us that they have already begun to censor themselves online or alternatively cancel their plans to come to the US, and both of those are extremely disturbing,” Rivers said.

At the time that the rule change was made, Twitter strongly opposed it. The platform said that it “could have a chilling effect on free speech and the willingness of people who use Twitter to engage in free expression and conversation”.

The lawsuit refers to an unnamed Turkish film-maker who belongs to IDA who has decided not to come to the US because he fears handing over his social media identifier. It cites another IDA member from Syria who is in particular danger because they use pseudonymous online accounts to share views on political and social issues.

Among those who are now reining in their social media speech is a film-maker who pseudonymously comments on the Trump administration, the lawsuit says.

The legal challenge lands at a time when international film-making is enjoying something of a golden era. This week For Sama, the documentary about life under siege in Aleppo at the heart of the Syrian war, swept the awards at the British independent film awards.

But the terrain remains challenging for many directors who rely on anonymity to mitigate the extreme risks they are taking. The lawsuit points out that in August the Burmese film-maker Min Htin Ko Ko Gyi, founder of Myanmar’s Human Dignity Film Institute, was reportedly sentenced to a year’s hard labor for criticizing the country’s armed forces on Facebook.