WASHINGTON (AP) — Facebook FB, +2.12% said Tuesday that the U.S. Department of Homeland Security would be violating the company’s rules if agents create fake profiles to monitor the social media of foreigners seeking to enter the country.

“Law enforcement authorities, like everyone else, are required to use their real names on Facebook and we make this policy clear,” Facebook spokeswoman Sarah Pollack told The Associated Press in a statement Tuesday. “Operating fake accounts is not allowed, and we will act on any violating accounts.”

Pollack said the company has communicated its concerns and its policies on the use of fake accounts to DHS. She said the company will shut down fake accounts, including those belonging to undercover law enforcement, when they are reported.

The company’s statement followed the AP’s report Friday that U.S. Citizenship and Immigration Services had authorized its officers to use fake social media accounts in a reversal of a previous ban on the practice.

Homeland Security explained the change to the AP in a statement Friday, stating that fake accounts would make it easier for agents reviewing visa, green card and citizenship applications to search for fraud or security threats. The department didn’t provide comment when asked Tuesday.

The plan would also be a violation of Twitter’s rules. Twitter said Friday that it’s still reviewing the new Homeland Security practice. It did not provide further comment.

The change in policy was preceded by other steps taken by the State Department, which began requiring applicants for U.S. visas to submit their social media usernames this past June, a vast expansion of the Trump administration’s enhanced screening of potential immigrants and visitors.

Such a review of social media would be conducted by officers in the agency’s Fraud Detection and National Security Directorate on cases flagged as requiring more investigation. The privacy assessment notes that officers can only review publicly available social media available to all users on the platform — they cannot “friend” or “follow” an individual — and must undergo annual training.

The officers are also not allowed to interact with users on the social media sites and can only passively review information, according to the DHS document.

While lots of social media activity can be viewed without an account, many platforms limit access without one.

Facebook said it has improved the ability to spot fake accounts through automation, blocking and removing millions of fake accounts daily.

Twitter and Facebook both recently shut down numerous accounts believed to be operated by the Chinese government using their platforms under false identities for information operations.